diff --git a/src/Ryujinx.Graphics.Gpu/Memory/VirtualBufferBounds.cs b/src/Ryujinx.Graphics.Gpu/Memory/VirtualBufferBounds.cs new file mode 100644 index 000000000..d4dcaae46 --- /dev/null +++ b/src/Ryujinx.Graphics.Gpu/Memory/VirtualBufferBounds.cs @@ -0,0 +1,34 @@ +namespace Ryujinx.Graphics.Gpu.Memory +{ + /// + /// Virtual memory range used for buffers. + /// + readonly struct VirtualBufferBounds + { + /// + /// Base virtual address. + /// + public ulong GpuVa { get; } + + /// + /// Binding size. + /// + public ulong Size { get; } + + /// + /// Creates a new virtual buffer region. + /// + /// Base virtual address + /// Binding size + public VirtualBufferBounds(ulong gpuVa, ulong size) + { + GpuVa = gpuVa; + Size = size; + } + + public bool Equals(ulong gpuVa, ulong size) + { + return GpuVa == gpuVa && Size == size; + } + } +} diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs index c9aab4018..5ddd157df 100644 --- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs +++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs @@ -1,4 +1,4 @@ -using Ryujinx.Common.Logging; +using Ryujinx.Common.Logging; using Ryujinx.Graphics.GAL; using Silk.NET.Vulkan; using System; @@ -130,9 +130,10 @@ namespace Ryujinx.Graphics.Vulkan UsePushDescriptors = usePushDescriptors; Stages = stages; + bool hasBatchedTextureSamplerBug = false;//gd.Vendor == Vendor.Qualcomm; ClearSegments = BuildClearSegments(sets); - BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, out bool usesBufferTextures); + BindingSegments = BuildBindingSegments(resourceLayout.SetUsages, hasBatchedTextureSamplerBug, out bool usesBufferTextures); Templates = BuildTemplates(usePushDescriptors); (IncoherentBufferWriteStages, IncoherentTextureWriteStages) = BuildIncoherentStages(resourceLayout.SetUsages); @@ -289,7 +290,7 @@ namespace Ryujinx.Graphics.Vulkan return segments; } - private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection setUsages, out bool usesBufferTextures) + private static ResourceBindingSegment[][] BuildBindingSegments(ReadOnlyCollection setUsages, bool hasBatchedTextureSamplerBug, out bool usesBufferTextures) { usesBufferTextures = false; @@ -313,6 +314,7 @@ namespace Ryujinx.Graphics.Vulkan if (currentUsage.Binding + currentCount != usage.Binding || currentUsage.Type != usage.Type || + (currentUsage.Type == ResourceType.TextureAndSampler && hasBatchedTextureSamplerBug) || currentUsage.Stages != usage.Stages || currentUsage.ArrayLength > 1 || usage.ArrayLength > 1)