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 --- .../IntermediateRepresentation/TextureOperation.cs | 30 +++++----------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs') diff --git a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs index b467fe53..fa5550a6 100644 --- a/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs +++ b/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs @@ -8,16 +8,14 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation public TextureFormat Format { get; set; } public TextureFlags Flags { get; private set; } - public int CbufSlot { get; private set; } - public int Handle { get; private set; } + public int Binding { get; private set; } public TextureOperation( Instruction inst, SamplerType type, TextureFormat format, TextureFlags flags, - int cbufSlot, - int handle, + int binding, int compIndex, Operand[] dests, Operand[] sources) : base(inst, compIndex, dests, sources) @@ -25,30 +23,17 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation Type = type; Format = format; Flags = flags; - CbufSlot = cbufSlot; - Handle = handle; + Binding = binding; } - public TextureOperation( - Instruction inst, - SamplerType type, - TextureFormat format, - TextureFlags flags, - int handle, - int compIndex, - Operand[] dests, - Operand[] sources) : this(inst, type, format, flags, DefaultCbufSlot, handle, compIndex, dests, sources) - { - } - - public void TurnIntoIndexed(int handle) + public void TurnIntoIndexed(int binding) { Type |= SamplerType.Indexed; Flags &= ~TextureFlags.Bindless; - Handle = handle; + Binding = binding; } - public void SetHandle(int handle, int cbufSlot = DefaultCbufSlot) + public void SetBinding(int binding) { if ((Flags & TextureFlags.Bindless) != 0) { @@ -57,8 +42,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation RemoveSource(0); } - CbufSlot = cbufSlot; - Handle = handle; + Binding = binding; } public void SetLodLevelFlag() -- cgit v1.2.3