Add work around for Adreno batched texture + sampler descriptor updates bug

This commit is contained in:
Gabriel A 2023-07-05 21:17:59 -03:00 committed by Emmanuel Hansen
parent e54e18dab8
commit 21a78f173e

View File

@ -117,8 +117,10 @@ namespace Ryujinx.Graphics.Vulkan
Stages = stages; Stages = stages;
bool hasBatchedTextureSamplerBug = gd.Vendor == Vendor.Qualcomm;
ClearSegments = BuildClearSegments(resourceLayout.Sets); ClearSegments = BuildClearSegments(resourceLayout.Sets);
BindingSegments = BuildBindingSegments(resourceLayout.SetUsages); BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, hasBatchedTextureSamplerBug);
Templates = BuildTemplates(); Templates = BuildTemplates();
_compileTask = Task.CompletedTask; _compileTask = Task.CompletedTask;
@ -191,7 +193,7 @@ namespace Ryujinx.Graphics.Vulkan
return segments; return segments;
} }
private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages) private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages, bool hasBatchedTextureSamplerBug)
{ {
ResourceBindingSegment[][] segments = new ResourceBindingSegment[setUsages.Count][]; ResourceBindingSegment[][] segments = new ResourceBindingSegment[setUsages.Count][];
@ -208,7 +210,9 @@ namespace Ryujinx.Graphics.Vulkan
if (currentUsage.Binding + currentCount != usage.Binding || if (currentUsage.Binding + currentCount != usage.Binding ||
currentUsage.Type != usage.Type || currentUsage.Type != usage.Type ||
currentUsage.Stages != usage.Stages) (currentUsage.Type == ResourceType.TextureAndSampler && hasBatchedTextureSamplerBug) ||
currentUsage.Stages != usage.Stages ||
currentUsage.Access != usage.Access)
{ {
if (currentCount != 0) if (currentCount != 0)
{ {