Ryujinx/Ryujinx.Graphics.OpenGL
riperiperi ec3e848d79
Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501)
* Initial Implementation

About as fast as nvidia GL multithreading, can be improved with faster command queuing.

* Struct based command list

Speeds up a bit. Still a lot of time lost to resource copy.

* Do shader init while the render thread is active.

* Introduce circular span pool V1

Ideally should be able to use structs instead of references for storing these spans on commands. Will try that next.

* Refactor SpanRef some more

Use a struct to represent SpanRef, rather than a reference.

* Flush buffers on background thread

* Use a span for UpdateRenderScale.

Much faster than copying the array.

* Calculate command size using reflection

* WIP parallel shaders

* Some minor optimisation

* Only 2 max refs per command now.

The command with 3 refs is gone. 😌

* Don't cast on the GPU side

* Remove redundant casts, force sync on window present

* Fix Shader Cache

* Fix host shader save.

* Fixup to work with new renderer stuff

* Make command Run static, use array of delegates as lookup

Profile says this takes less time than the previous way.

* Bring up to date

* Add settings toggle. Fix Muiltithreading Off mode.

* Fix warning.

* Release tracking lock for flushes

* Fix Conditional Render fast path with threaded gal

* Make handle iteration safe when releasing the lock

This is mostly temporary.

* Attempt to set backend threading on driver

Only really works on nvidia before launching a game.

* Fix race condition with BufferModifiedRangeList, exceptions in tracking actions

* Update buffer set commands

* Some cleanup

* Only use stutter workaround when using opengl renderer non-threaded

* Add host-conditional reservation of counter events

There has always been the possibility that conditional rendering could use a query object just as it is disposed by the counter queue. This change makes it so that when the host decides to use host conditional rendering, the query object is reserved so that it cannot be deleted. Counter events can optionally start reserved, as the threaded implementation can reserve them before the backend creates them, and there would otherwise be a short amount of time where the counter queue could dispose the event before a call to reserve it could be made.

* Address Feedback

* Make counter flush tracked again.

Hopefully does not cause any issues this time.

* Wait for FlushTo on the main queue thread.

Currently assumes only one thread will want to FlushTo (in this case, the GPU thread)

* Add SDL2 headless integration

* Add HLE macro commands.

Co-authored-by: Mary <mary@mary.zone>
2021-08-27 00:31:29 +02:00
..
Helper Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Image Swap BGR565 components by changing the format (#2577) 2021-08-26 22:47:21 +02:00
Queries Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501) 2021-08-27 00:31:29 +02:00
BackgroundContextWorker.cs Assign _backgroundContext before starting its worker thread. (#2299) 2021-05-20 15:29:10 +02:00
Buffer.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
Constants.cs Fix transform feedback errors caused by host pause/resume and multiple uses (#1634) 2020-10-25 17:23:42 -03:00
Debugger.cs Rename DebugLevel Performance to Slowdowns (#1450) 2020-08-07 15:30:06 +02:00
EnumConversion.cs Fix incorrect GPU GL blend func values (#1612) 2020-10-13 14:45:41 +11:00
FormatInfo.cs Add basic error logging to the GPU 2020-01-09 02:13:00 +01:00
FormatTable.cs Swap BGR components for 16-bit BGR texture formats (#2567) 2021-08-20 18:26:25 -03:00
Framebuffer.cs Use copy dependencies for the Intel/AMD view format workaround (#2144) 2021-05-16 20:43:27 +02:00
Handle.cs Spanify Graphics Abstraction Layer (#1226) 2020-05-23 11:46:09 +02:00
HwCapabilities.cs Add support for HLE macros and accelerate MultiDrawElementsIndirectCount #2 (#2557) 2021-08-26 23:50:28 +02:00
IOpenGLContext.cs Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
PersistentBuffers.cs Return mapped buffer pointer directly for flush, WriteableRegion for textures (#2494) 2021-07-19 19:10:54 -03:00
Pipeline.cs Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501) 2021-08-27 00:31:29 +02:00
Program.cs Replace BGRA and scale uniforms with a uniform block (#2496) 2021-08-11 21:33:43 +02:00
Renderer.cs Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501) 2021-08-27 00:31:29 +02:00
ResourcePool.cs Texture/Buffer Memory Management Improvements (#1408) 2020-09-10 16:44:04 -03:00
Ryujinx.Graphics.OpenGL.csproj Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Shader.cs Use explicit buffer and texture bindings on shaders (#1666) 2020-11-08 12:10:00 +01:00
Sync.cs Only flush commands when creating sync on Intel/AMD (windows) (#2165) 2021-04-03 11:10:37 +11:00
VertexArray.cs Add support for HLE macros and accelerate MultiDrawElementsIndirectCount #2 (#2557) 2021-08-26 23:50:28 +02:00
VertexBuffer.cs Initial work 2020-01-09 02:13:00 +01:00
Window.cs Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501) 2021-08-27 00:31:29 +02:00