Simplify logic for bindless texture handling (#1667)

* Simplify logic for bindless texture handling

* Nits
This commit is contained in:
gdkchan 2020-11-09 19:35:04 -03:00 committed by GitHub
parent eda6b78894
commit 934a78005e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 131 additions and 191 deletions

View file

@ -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;
}
}
}