From 8a2b56cae685483f8193c190e80e6781afa93bec Mon Sep 17 00:00:00 2001 From: Jonas Henriksson Date: Fri, 29 Nov 2024 00:00:12 +0100 Subject: [PATCH] Fix logic surrounding PushDescriptors in Vulkan (#257) --- src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs index c9aab4018..436914330 100644 --- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs +++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs @@ -182,6 +182,16 @@ namespace Ryujinx.Graphics.Vulkan return false; } } + + //Prevent the sum of descriptors from exceeding MaxPushDescriptors + int totalDescriptors = 0; + foreach (ResourceDescriptor desc in layout.Sets.First().Descriptors) + { + if (!reserved.Contains(desc.Binding)) + totalDescriptors += desc.Count; + } + if (totalDescriptors > gd.Capabilities.MaxPushDescriptors) + return false; return true; }