Fix logic surrounding PushDescriptors in Vulkan #257
@ -170,12 +170,6 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
bool hasBinding3 = uniformUsage.Any(x => x.Binding == 3);
|
bool hasBinding3 = uniformUsage.Any(x => x.Binding == 3);
|
||||||
int[] reserved = isCompute ? Array.Empty<int>() : gd.GetPushDescriptorReservedBindings(hasBinding3);
|
int[] reserved = isCompute ? Array.Empty<int>() : gd.GetPushDescriptorReservedBindings(hasBinding3);
|
||||||
|
|
||||||
//Prevent the sum of descriptors from exceeding MaxPushDescriptors
|
|
||||||
if (layout.Sets.First().Descriptors.Where(descriptor => !reserved.Contains(descriptor.Binding)).Sum(descriptor => descriptor.Count) > gd.Capabilities.MaxPushDescriptors)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Can't use any of the reserved usages.
|
// Can't use any of the reserved usages.
|
||||||
for (int i = 0; i < uniformUsage.Count; i++)
|
for (int i = 0; i < uniformUsage.Count; i++)
|
||||||
{
|
{
|
||||||
@ -189,6 +183,16 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user