From 934a78005e75653529c320cf90e78fe6536447c2 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 9 Nov 2020 19:35:04 -0300 Subject: Simplify logic for bindless texture handling (#1667) * Simplify logic for bindless texture handling * Nits --- .../IntermediateRepresentation/TextureOperation.cs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs') 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 -- cgit v1.2.3