using Ryujinx.Graphics.GAL;
namespace Ryujinx.Graphics.Gpu.Image
{
///
/// Texture binding information.
/// This is used for textures that needs to be accessed from shaders.
///
struct TextureBindingInfo
{
///
/// Shader sampler target type.
///
public Target Target { get; }
///
/// Shader texture handle.
/// This is a index into the texture constant buffer.
///
public int Handle { get; }
///
/// Indicates if the texture is a bindless texture.
/// For those textures, Handle is ignored.
///
public bool IsBindless { get; }
///
/// Constant buffer slot with the bindless texture handle, for bindless texture.
///
public int CbufSlot { get; }
///
/// Constant buffer offset of the bindless texture handle, for bindless texture.
///
public int CbufOffset { get; }
///
/// Constructs the texture binding information structure.
///
/// The shader sampler target type
/// The shader texture handle (read index into the texture constant buffer)
public TextureBindingInfo(Target target, int handle)
{
Target = target;
Handle = handle;
IsBindless = false;
CbufSlot = 0;
CbufOffset = 0;
}
///
/// Constructs the bindless texture binding information structure.
///
/// The shader sampler target type
/// Constant buffer slot where the bindless texture handle is located
/// Constant buffer offset of the bindless texture handle
public TextureBindingInfo(Target target, int cbufSlot, int cbufOffset)
{
Target = target;
Handle = 0;
IsBindless = true;
CbufSlot = cbufSlot;
CbufOffset = cbufOffset;
}
}
}