MemoryLayout.cs 740 B

1234567891011121314151617181920212223242526272829303132333435
  1. namespace Ryujinx.Graphics.Gpu.State
  2. {
  3. /// <summary>
  4. /// Memory layout parameters, for block linear textures.
  5. /// </summary>
  6. struct MemoryLayout
  7. {
  8. public uint Packed;
  9. public int UnpackGobBlocksInX()
  10. {
  11. return 1 << (int)(Packed & 0xf);
  12. }
  13. public int UnpackGobBlocksInY()
  14. {
  15. return 1 << (int)((Packed >> 4) & 0xf);
  16. }
  17. public int UnpackGobBlocksInZ()
  18. {
  19. return 1 << (int)((Packed >> 8) & 0xf);
  20. }
  21. public bool UnpackIsLinear()
  22. {
  23. return (Packed & 0x1000) != 0;
  24. }
  25. public bool UnpackIsTarget3D()
  26. {
  27. return (Packed & 0x10000) != 0;
  28. }
  29. }
  30. }