Explorar o código

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.
Ac_K %!s(int64=5) %!d(string=hai) anos
pai
achega
4f01c13f50
Modificáronse 1 ficheiros con 11 adicións e 3 borrados
  1. 11 3
      Ryujinx.HLE/HOS/Services/SurfaceFlinger/SurfaceFlinger.cs

+ 11 - 3
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,