diff options
author | Mary <mary@mary.zone> | 2023-02-13 21:32:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-13 20:32:20 +0000 |
commit | 052b23c83c3a58afdd63c3d5a7655be482f1c739 (patch) | |
tree | dd9a02c1936596099dcef3fe5952364f8047be76 /Ryujinx.Graphics.Vulkan/PipelineBase.cs | |
parent | e4f68592c3a6e51414e5f78eef096f21bf735eb1 (diff) |
vulkan: Do not call vkCmdSetViewport when viewportCount is 0 (#4406)1.1.618
This fix validation error "VUID-vkCmdSetViewport-viewportCount-arraylength".
Diffstat (limited to 'Ryujinx.Graphics.Vulkan/PipelineBase.cs')
-rw-r--r-- | Ryujinx.Graphics.Vulkan/PipelineBase.cs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Vulkan/PipelineBase.cs b/Ryujinx.Graphics.Vulkan/PipelineBase.cs index 43dccf86..02b1c389 100644 --- a/Ryujinx.Graphics.Vulkan/PipelineBase.cs +++ b/Ryujinx.Graphics.Vulkan/PipelineBase.cs @@ -650,9 +650,7 @@ namespace Ryujinx.Graphics.Vulkan _newState.DepthWriteEnable = oldDepthWriteEnable; _newState.Topology = oldTopology; - DynamicState.Viewports = oldViewports; - DynamicState.ViewportsCount = (int)oldViewportsCount; - DynamicState.SetViewportsDirty(); + DynamicState.SetViewports(ref oldViewports, oldViewportsCount); _newState.ViewportsCount = oldViewportsCount; SignalStateChange(); @@ -1183,6 +1181,8 @@ namespace Ryujinx.Graphics.Vulkan return Math.Clamp(value, 0f, 1f); } + DynamicState.ViewportsCount = (uint)count; + for (int i = 0; i < count; i++) { var viewport = viewports[i]; @@ -1196,8 +1196,6 @@ namespace Ryujinx.Graphics.Vulkan Clamp(viewport.DepthFar))); } - DynamicState.ViewportsCount = count; - float disableTransformF = disableTransform ? 1.0f : 0.0f; if (SupportBufferUpdater.Data.ViewportInverse.W != disableTransformF || disableTransform) { |