Skip to content

Commit

Permalink
Fix logic surrounding PushDescriptors in Vulkan (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
gr3ger authored Nov 28, 2024
1 parent baf179e commit 8a2b56c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ private static bool CanUsePushDescriptors(VulkanRenderer gd, ResourceLayout layo
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;
}
Expand Down

0 comments on commit 8a2b56c

Please sign in to comment.