aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/IntermediateRepresentation
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-11-09 19:35:04 -0300
committerGitHub <noreply@github.com>2020-11-09 19:35:04 -0300
commit934a78005e75653529c320cf90e78fe6536447c2 (patch)
treea0601ef1abfbace3c35c10fb048d2e33447054c2 /Ryujinx.Graphics.Shader/IntermediateRepresentation
parenteda6b78894eef3d9dc1e8ea6984e2f5bd319d68e (diff)
Simplify logic for bindless texture handling (#1667)
* Simplify logic for bindless texture handling * Nits
Diffstat (limited to 'Ryujinx.Graphics.Shader/IntermediateRepresentation')
-rw-r--r--Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs16
1 files changed, 11 insertions, 5 deletions
diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs
index 9c5cd25c..52f02bfb 100644
--- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs
+++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs
@@ -2,9 +2,13 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
{
class TextureOperation : Operation
{
+ private const int DefaultCbufSlot = -1;
+
public SamplerType Type { get; private set; }
public TextureFlags Flags { get; private set; }
+ public int CbufSlot { get; private set; }
+
public int Handle { get; private set; }
public TextureFormat Format { get; set; }
@@ -18,9 +22,10 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
Operand dest,
params Operand[] sources) : base(inst, compIndex, dest, sources)
{
- Type = type;
- Flags = flags;
- Handle = handle;
+ Type = type;
+ Flags = flags;
+ CbufSlot = DefaultCbufSlot;
+ Handle = handle;
}
public void TurnIntoIndexed(int handle)
@@ -30,7 +35,7 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
Handle = handle;
}
- public void SetHandle(int handle)
+ public void SetHandle(int handle, int cbufSlot = DefaultCbufSlot)
{
if ((Flags & TextureFlags.Bindless) != 0)
{
@@ -39,7 +44,8 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
RemoveSource(0);
}
- Handle = handle;
+ CbufSlot = cbufSlot;
+ Handle = handle;
}
}
} \ No newline at end of file