Explorar o código

Fix compute restore of previous shader state (#1352)

gdkchan %!s(int64=5) %!d(string=hai) anos
pai
achega
b0d9ec8a82

+ 1 - 1
Ryujinx.Graphics.Gpu/Engine/Compute.cs

@@ -163,7 +163,7 @@ namespace Ryujinx.Graphics.Gpu.Engine
                 qmd.CtaRasterHeight,
                 qmd.CtaRasterDepth);
 
-            UpdateShaderState(state);
+            _forceShaderUpdate = true;
         }
     }
 }

+ 5 - 1
Ryujinx.Graphics.Gpu/Engine/Methods.cs

@@ -38,6 +38,8 @@ namespace Ryujinx.Graphics.Gpu.Engine
         private bool _isAnyVbInstanced;
         private bool _vsUsesInstanceId;
 
+        private bool _forceShaderUpdate;
+
         /// <summary>
         /// Creates a new instance of the GPU methods class.
         /// </summary>
@@ -121,8 +123,10 @@ namespace Ryujinx.Graphics.Gpu.Engine
             // Shaders must be the first one to be updated if modified, because
             // some of the other state depends on information from the currently
             // bound shaders.
-            if (state.QueryModified(MethodOffset.ShaderBaseAddress, MethodOffset.ShaderState))
+            if (state.QueryModified(MethodOffset.ShaderBaseAddress, MethodOffset.ShaderState) || _forceShaderUpdate)
             {
+                _forceShaderUpdate = false;
+
                 UpdateShaderState(state);
             }