1
0
Fork 0
mirror of https://github.com/Ryujinx/Ryujinx.git synced 2024-12-11 23:52:00 +00:00
Ryujinx/Ryujinx.Graphics.Gpu/State/VertexAttribState.cs

38 lines
1,016 B
C#
Raw Normal View History

2019-10-13 07:02:07 +01:00
namespace Ryujinx.Graphics.Gpu.State
{
/// <summary>
/// Vertex buffer attribute state.
/// </summary>
2019-10-13 07:02:07 +01:00
struct VertexAttribState
{
public uint Attribute;
/// <summary>
/// Unpacks the index of the vertex buffer this attribute belongs to.
/// </summary>
/// <returns>Vertex buffer index</returns>
2019-10-13 07:02:07 +01:00
public int UnpackBufferIndex()
{
return (int)(Attribute & 0x1f);
}
/// <summary>
/// Unpacks the offset, in bytes, of the attribute on the vertex buffer.
/// </summary>
/// <returns>Attribute offset in bytes</returns>
2019-10-13 07:02:07 +01:00
public int UnpackOffset()
{
return (int)((Attribute >> 7) & 0x3fff);
}
/// <summary>
/// Unpacks the Maxwell attribute format integer.
/// </summary>
/// <returns>Attribute format integer</returns>
2019-10-13 07:02:07 +01:00
public uint UnpackFormat()
{
return Attribute & 0x3fe00000;
}
}
}