From 1c7a90ef359d9974e5bd257c4d8e9bf526a6966c Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
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
---
 src/Ryujinx.Graphics.Shader/BufferDescriptor.cs | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

(limited to 'src/Ryujinx.Graphics.Shader/BufferDescriptor.cs')

diff --git a/src/Ryujinx.Graphics.Shader/BufferDescriptor.cs b/src/Ryujinx.Graphics.Shader/BufferDescriptor.cs
index d1da9539..d8cad1df 100644
--- a/src/Ryujinx.Graphics.Shader/BufferDescriptor.cs
+++ b/src/Ryujinx.Graphics.Shader/BufferDescriptor.cs
@@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Shader
         public readonly byte Slot;
         public readonly byte SbCbSlot;
         public readonly ushort SbCbOffset;
-        public BufferUsageFlags Flags;
+        public readonly BufferUsageFlags Flags;
 
         public BufferDescriptor(int binding, int slot)
         {
@@ -16,25 +16,16 @@ namespace Ryujinx.Graphics.Shader
             Slot = (byte)slot;
             SbCbSlot = 0;
             SbCbOffset = 0;
-
             Flags = BufferUsageFlags.None;
         }
 
-        public BufferDescriptor(int binding, int slot, int sbCbSlot, int sbCbOffset)
+        public BufferDescriptor(int binding, int slot, int sbCbSlot, int sbCbOffset, BufferUsageFlags flags)
         {
             Binding = binding;
             Slot = (byte)slot;
             SbCbSlot = (byte)sbCbSlot;
             SbCbOffset = (ushort)sbCbOffset;
-
-            Flags = BufferUsageFlags.None;
-        }
-
-        public BufferDescriptor SetFlag(BufferUsageFlags flag)
-        {
-            Flags |= flag;
-
-            return this;
+            Flags = flags;
         }
     }
 }
-- 
cgit v1.2.3-70-g09d2