namespace Ryujinx.Graphics.Gpu.State
{
///
/// Vertex buffer attribute state.
///
struct VertexAttribState
{
#pragma warning disable CS0649
public uint Attribute;
#pragma warning restore CS0649
///
/// Unpacks the index of the vertex buffer this attribute belongs to.
///
/// Vertex buffer index
public int UnpackBufferIndex()
{
return (int)(Attribute & 0x1f);
}
///
/// Unpacks the attribute constant flag.
///
/// True if the attribute is constant, false otherwise
public bool UnpackIsConstant()
{
return (Attribute & 0x40) != 0;
}
///
/// Unpacks the offset, in bytes, of the attribute on the vertex buffer.
///
/// Attribute offset in bytes
public int UnpackOffset()
{
return (int)((Attribute >> 7) & 0x3fff);
}
///
/// Unpacks the Maxwell attribute format integer.
///
/// Attribute format integer
public uint UnpackFormat()
{
return Attribute & 0x3fe00000;
}
}
}