diff options
| author | Ac_K <Acoustik666@gmail.com> | 2021-01-02 23:21:44 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-02 23:21:44 +0100 |
| commit | 4f01c13f5054e3af775fc956584b553da934d476 (patch) | |
| tree | c54b99d353836af7f2a0ac93a6ec71c2dabf14bb | |
| parent | 3e7383b3fdf78d88a25dc2f5d285a847596158f4 (diff) | |
surfaceflinger: Fix fence callback issue (#1839)
This PR fixes a regression introduced in #1741. The actual implementation do the assumption of fences always exist and then registering the callback.
Homebrews may not use fences, so the code crashes when it try to register the callback.
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs index cec37a58..297acdda 100644 --- a/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs +++ b/Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs @@ -345,14 +345,22 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger TextureCallbackInformation textureCallbackInformation = new TextureCallbackInformation { Layer = layer, - Item = item, + Item = item }; - item.Fence.RegisterCallback(_device.Gpu, () => + if (item.Fence.FenceCount == 0) { _device.Gpu.Window.SignalFrameReady(); _device.Gpu.GPFifo.Interrupt(); - }); + } + else + { + item.Fence.RegisterCallback(_device.Gpu, () => + { + _device.Gpu.Window.SignalFrameReady(); + _device.Gpu.GPFifo.Interrupt(); + }); + } _device.Gpu.Window.EnqueueFrameThreadSafe( frameBufferAddress, |
