From 3e6e0e4afaa3c3ffb118cb17b61feb16966a7eeb Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 7 Apr 2024 18:25:55 -0300 Subject: Add support for large sampler arrays on Vulkan (#6489) * Add support for large sampler arrays on Vulkan * Shader cache version bump * Format whitespace * Move DescriptorSetManager to PipelineLayoutCacheEntry to allow different pool sizes per layout * Handle array textures with different types on the same buffer * Somewhat better caching system * Avoid useless buffer data modification checks * Move redundant bindings update checking to the backend * Fix an issue where texture arrays would get the same bindings across stages on Vulkan * Backport some fixes from part 2 * Fix typo * PR feedback * Format whitespace * Add some missing XML docs --- src/Ryujinx.Graphics.Shader/IGpuAccessor.cs | 43 +++++++++++++---------------- 1 file changed, 19 insertions(+), 24 deletions(-) (limited to 'src/Ryujinx.Graphics.Shader/IGpuAccessor.cs') diff --git a/src/Ryujinx.Graphics.Shader/IGpuAccessor.cs b/src/Ryujinx.Graphics.Shader/IGpuAccessor.cs index df6d29dc..99366ad6 100644 --- a/src/Ryujinx.Graphics.Shader/IGpuAccessor.cs +++ b/src/Ryujinx.Graphics.Shader/IGpuAccessor.cs @@ -26,47 +26,42 @@ namespace Ryujinx.Graphics.Shader /// Span of the memory location ReadOnlySpan GetCode(ulong address, int minimumSize); + /// + /// Gets the size in bytes of a bound constant buffer for the current shader stage. + /// + /// The number of the constant buffer to get the size from + /// Size in bytes + int QueryTextureArrayLengthFromBuffer(int slot); + /// /// Queries the binding number of a constant buffer. /// /// Constant buffer index /// Binding number - int QueryBindingConstantBuffer(int index) - { - return index + 1; - } + int CreateConstantBufferBinding(int index); /// - /// Queries the binding number of a storage buffer. + /// Queries the binding number of an image. /// - /// Storage buffer index + /// For array of images, the number of elements of the array, otherwise it should be 1 + /// Indicates if the image is a buffer image /// Binding number - int QueryBindingStorageBuffer(int index) - { - return index; - } + int CreateImageBinding(int count, bool isBuffer); /// - /// Queries the binding number of a texture. + /// Queries the binding number of a storage buffer. /// - /// Texture index - /// Indicates if the texture is a buffer texture + /// Storage buffer index /// Binding number - int QueryBindingTexture(int index, bool isBuffer) - { - return index; - } + int CreateStorageBufferBinding(int index); /// - /// Queries the binding number of an image. + /// Queries the binding number of a texture. /// - /// Image index - /// Indicates if the image is a buffer image + /// For array of textures, the number of elements of the array, otherwise it should be 1 + /// Indicates if the texture is a buffer texture /// Binding number - int QueryBindingImage(int index, bool isBuffer) - { - return index; - } + int CreateTextureBinding(int count, bool isBuffer); /// /// Queries Local Size X for compute shaders. -- cgit v1.2.3