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