From 66f16f43921bdd6d0f706d09aa37166d374dec2e Mon Sep 17 00:00:00 2001 From: gdkchan Date: Tue, 13 Sep 2022 03:53:55 -0300 Subject: Fix bindless 1D textures having a buffer type on the shader (#3697) * Fix bindless 1D textures having a buffer type on the shader * Shader cache version bump --- .../IntermediateRepresentation/Operation.cs | 12 ++++++++++++ .../IntermediateRepresentation/TextureOperation.cs | 5 +++++ 2 files changed, 17 insertions(+) (limited to 'Ryujinx.Graphics.Shader/IntermediateRepresentation') diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs index 955beafd..96132633 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs @@ -180,6 +180,18 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation _sources[index] = source; } + public void InsertSource(int index, Operand source) + { + Operand[] newSources = new Operand[_sources.Length + 1]; + + Array.Copy(_sources, 0, newSources, 0, index); + Array.Copy(_sources, index, newSources, index + 1, _sources.Length - index); + + newSources[index] = source; + + _sources = newSources; + } + protected void RemoveSource(int index) { SetSource(index, null); diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs index ea9ae39c..8cfcb0e9 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs @@ -60,5 +60,10 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation CbufSlot = cbufSlot; Handle = handle; } + + public void SetLodLevelFlag() + { + Flags |= TextureFlags.LodLevel; + } } } \ No newline at end of file -- cgit v1.2.3