From 1c7a90ef359d9974e5bd257c4d8e9bf526a6966c Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 3 Jul 2023 14:29:27 -0300 Subject: Stop identifying shader textures with handle and cbuf, use binding instead (#5266) * Stop identifying shader textures with handle and cbuf, use binding instead * Remove now unused code * Consider image operations as having accurate type information too I don't know why that was not the case before * Fix missing unscale on InsertCoordNormalization, stop calling SetUsageFlagsForTextureQuery when not needed * Shader cache version bump * Change get texture methods to return descriptors created from ResourceManager state This is required to ensure that reserved textures and images will not be bound as a guest texture/image * Fix BindlessElimination.SetHandle inserting coords at the wrong place --- .../StructuredIr/ShaderProperties.cs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/Ryujinx.Graphics.Shader/StructuredIr/ShaderProperties.cs') diff --git a/src/Ryujinx.Graphics.Shader/StructuredIr/ShaderProperties.cs b/src/Ryujinx.Graphics.Shader/StructuredIr/ShaderProperties.cs index 1da5cb65..048a260a 100644 --- a/src/Ryujinx.Graphics.Shader/StructuredIr/ShaderProperties.cs +++ b/src/Ryujinx.Graphics.Shader/StructuredIr/ShaderProperties.cs @@ -6,11 +6,15 @@ namespace Ryujinx.Graphics.Shader.StructuredIr { private readonly Dictionary _constantBuffers; private readonly Dictionary _storageBuffers; + private readonly Dictionary _textures; + private readonly Dictionary _images; private readonly Dictionary _localMemories; private readonly Dictionary _sharedMemories; public IReadOnlyDictionary ConstantBuffers => _constantBuffers; public IReadOnlyDictionary StorageBuffers => _storageBuffers; + public IReadOnlyDictionary Textures => _textures; + public IReadOnlyDictionary Images => _images; public IReadOnlyDictionary LocalMemories => _localMemories; public IReadOnlyDictionary SharedMemories => _sharedMemories; @@ -18,20 +22,32 @@ namespace Ryujinx.Graphics.Shader.StructuredIr { _constantBuffers = new Dictionary(); _storageBuffers = new Dictionary(); + _textures = new Dictionary(); + _images = new Dictionary(); _localMemories = new Dictionary(); _sharedMemories = new Dictionary(); } - public void AddConstantBuffer(int binding, BufferDefinition definition) + public void AddOrUpdateConstantBuffer(int binding, BufferDefinition definition) { _constantBuffers[binding] = definition; } - public void AddStorageBuffer(int binding, BufferDefinition definition) + public void AddOrUpdateStorageBuffer(int binding, BufferDefinition definition) { _storageBuffers[binding] = definition; } + public void AddOrUpdateTexture(int binding, TextureDefinition descriptor) + { + _textures[binding] = descriptor; + } + + public void AddOrUpdateImage(int binding, TextureDefinition descriptor) + { + _images[binding] = descriptor; + } + public int AddLocalMemory(MemoryDefinition definition) { int id = _localMemories.Count; -- cgit v1.2.3