1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-12 01:52:03 +00:00
Ryujinx/Ryujinx.Graphics.OpenGL
riperiperi 646d4dd5c7
Fix deadlock for GPU counter report when 0 draws are done (#3019)
This fixes a rare bug where reporting a counter for a region containing 0 draws could deadlock the GPU. If this write overlaps with a tracking action, then the GPU could end up waiting on something that it's meant to do in the future, so it would just get stuck.

Before, this reported immediately and wrote the result to guest memory (tracked) from the backend thread.

The backend thread cannot be allowed to trigger read actions that wait on the GPU, as it will end up waiting on itself, and never advancing.

In the case of backend multithreading's `SyncMap`, it would try to wait for a backend sync object that does not yet exist, as the sync object would exist according to the GPU and tracking, but it has not yet been created by the backend (and never will be, since it's stuck).

The fix is to queue the 0 draw event just like any other, its _bufferMap value is just forced to 0.

This affects games that use Conditional Rendering: SMO, Splatoon 2, MK8. Was generally indicated by a red message in log saying that the query result timed out after 5000 tries, but not always the cause.
2022-01-21 19:19:15 -03:00
..
Helper Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
Image Texture Sync, incompatible overlap handling, data flush improvements. (#2971) 2022-01-09 13:28:48 -03:00
Queries Fix deadlock for GPU counter report when 0 draws are done (#3019) 2022-01-21 19:19:15 -03: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
DrawTextureEmulation.cs Implement DrawTexture functionality (#2747) 2021-11-10 15:37:49 -03:00
EnumConversion.cs Initial tessellation shader support (#2534) 2021-10-18 18:38:04 -03:00
FormatInfo.cs
FormatTable.cs Fix A1B5G5R5 format for good (#2955) 2021-12-30 14:00:34 +01: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 Implement DrawTexture functionality (#2747) 2021-11-10 15:37:49 -03:00
IOpenGLContext.cs Miria: The Death of OpenTK 3 (#2194) 2021-04-14 12:28:43 +02:00
PersistentBuffers.cs Texture Sync, incompatible overlap handling, data flush improvements. (#2971) 2022-01-09 13:28:48 -03:00
Pipeline.cs Fix render target clear when sizes mismatch (#2994) 2022-01-11 20:15:17 +01:00
Program.cs Stop using glTransformFeedbackVaryings and use explicit layout on the shader (#3012) 2022-01-21 12:35:21 -03:00
Renderer.cs Stop using glTransformFeedbackVaryings and use explicit layout on the shader (#3012) 2022-01-21 12:35:21 -03:00
ResourcePool.cs Texture/Buffer Memory Management Improvements (#1408) 2020-09-10 16:44:04 -03:00
Ryujinx.Graphics.OpenGL.csproj infra: Migrate to .NET 6 (#2829) 2021-11-28 21:24:17 +01: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
Window.cs Add a Multithreading layer for the GAL, multi-thread shader compilation at runtime (#2501) 2021-08-27 00:31:29 +02:00