Ryujinx/src/Ryujinx.Graphics.Shader/IntermediateRepresentation/TextureOperation.cs
gdkchan 1c7a90ef35
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
2023-07-03 14:29:27 -03:00

53 lines
1.3 KiB
C#

namespace Ryujinx.Graphics.Shader.IntermediateRepresentation
{
class TextureOperation : Operation
{
public const int DefaultCbufSlot = -1;
public SamplerType Type { get; set; }
public TextureFormat Format { get; set; }
public TextureFlags Flags { get; private set; }
public int Binding { get; private set; }
public TextureOperation(
Instruction inst,
SamplerType type,
TextureFormat format,
TextureFlags flags,
int binding,
int compIndex,
Operand[] dests,
Operand[] sources) : base(inst, compIndex, dests, sources)
{
Type = type;
Format = format;
Flags = flags;
Binding = binding;
}
public void TurnIntoIndexed(int binding)
{
Type |= SamplerType.Indexed;
Flags &= ~TextureFlags.Bindless;
Binding = binding;
}
public void SetBinding(int binding)
{
if ((Flags & TextureFlags.Bindless) != 0)
{
Flags &= ~TextureFlags.Bindless;
RemoveSource(0);
}
Binding = binding;
}
public void SetLodLevelFlag()
{
Flags |= TextureFlags.LodLevel;
}
}
}