From 73881fad1995e079eae3e728cb2f4c657886e476 Mon Sep 17 00:00:00 2001 From: Mary Date: Tue, 13 Apr 2021 02:56:16 +0200 Subject: Surface Flinger: Fix an oversight when closing a layer (#2192) * Surface Flinger: Fix an oversight when closing a layer As the title say. I also took the liberty of changing the logic on how we select the current layer being rendered to make it more explicit when opening and creating layers. NOTE: Found by Ac_k. * check for RenderLayerId and not the dictionary size This fix a possible race condition between the time you create a layer and set the one currently used for rendering --- .../Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService') diff --git a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs index 6b874722..4d3bef50 100644 --- a/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs +++ b/Ryujinx.HLE/HOS/Services/Vi/RootService/ApplicationDisplayService/IManagerDisplayService.cs @@ -22,6 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Vi.RootService.ApplicationDisplayService long pid = context.Device.System.AppletState.AppletResourceUserIds.GetData((int)appletResourceUserId); context.Device.System.SurfaceFlinger.CreateLayer(pid, out long layerId); + context.Device.System.SurfaceFlinger.SetRenderLayer(layerId); context.ResponseData.Write(layerId); -- cgit v1.2.3