VertexBufferState.cs 862 B

1234567891011121314151617181920212223242526272829303132
  1. namespace Ryujinx.Graphics.Gpu.State
  2. {
  3. /// <summary>
  4. /// Vertex buffer state.
  5. /// </summary>
  6. struct VertexBufferState
  7. {
  8. #pragma warning disable CS0649
  9. public uint Control;
  10. public GpuVa Address;
  11. public int Divisor;
  12. #pragma warning restore CS0649
  13. /// <summary>
  14. /// Vertex buffer stride, defined as the number of bytes occupied by each vertex in memory.
  15. /// </summary>
  16. /// <returns>Vertex buffer stride</returns>
  17. public int UnpackStride()
  18. {
  19. return (int)(Control & 0xfff);
  20. }
  21. /// <summary>
  22. /// Vertex buffer enable.
  23. /// </summary>
  24. /// <returns>True if the vertex buffer is enabled, false otherwise</returns>
  25. public bool UnpackEnable()
  26. {
  27. return (Control & (1 << 12)) != 0;
  28. }
  29. }
  30. }