diff options
author | gdkchan <gab.dark.100@gmail.com> | 2024-07-07 19:19:55 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-07 19:19:55 -0300 |
commit | cfc75d7e78a63fe3bde06b6e4896a42e8dedaf82 (patch) | |
tree | 19bba5c292732e32e4e43a5974f42f359d593e24 /src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs | |
parent | c525d7d9a9a29fcca33ac3e12cef3c6c7e94b158 (diff) |
Disable descriptor set template updates for buffer textures on Adreno (#7002)1.1.1342
* Do not use template updates for buffer textures and buffer images
* No need to do it for images
* Simply buffer texture existence check
* Pipeline is now unused on DescriptorSetUpdater
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs index f9637789..eec2a318 100644 --- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs +++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs @@ -23,6 +23,8 @@ namespace Ryujinx.Graphics.Vulkan public bool IsCompute { get; } public bool HasTessellationControlShader => (Stages & (1u << 3)) != 0; + public bool UpdateTexturesWithoutTemplate { get; } + public uint Stages { get; } public ResourceBindingSegment[][] ClearSegments { get; } @@ -127,9 +129,12 @@ namespace Ryujinx.Graphics.Vulkan Stages = stages; ClearSegments = BuildClearSegments(sets); - BindingSegments = BuildBindingSegments(resourceLayout.SetUsages); + BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, out bool usesBufferTextures); Templates = BuildTemplates(usePushDescriptors); + // Updating buffer texture bindings using template updates crashes the Adreno driver on Windows. + UpdateTexturesWithoutTemplate = gd.Vendor == Vendor.Qualcomm && usesBufferTextures; + _compileTask = Task.CompletedTask; _firstBackgroundUse = false; } @@ -280,8 +285,10 @@ namespace Ryujinx.Graphics.Vulkan return segments; } - private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages) + private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection<ResourceUsageCollection> setUsages, out bool usesBufferTextures) { + usesBufferTextures = false; + ResourceBindingSegment[][] segments = new ResourceBindingSegment[setUsages.Count][]; for (int setIndex = 0; setIndex < setUsages.Count; setIndex++) @@ -295,6 +302,11 @@ namespace Ryujinx.Graphics.Vulkan { ResourceUsage usage = setUsages[setIndex].Usages[index]; + if (usage.Type == ResourceType.BufferTexture) + { + usesBufferTextures = true; + } + if (currentUsage.Binding + currentCount != usage.Binding || currentUsage.Type != usage.Type || currentUsage.Stages != usage.Stages || |