CopyBufferSwizzle.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. namespace Ryujinx.Graphics.Gpu.State
  2. {
  3. /// <summary>
  4. /// Buffer to buffer copy vector swizzle parameters.
  5. /// </summary>
  6. struct CopyBufferSwizzle
  7. {
  8. public uint Swizzle;
  9. /// <summary>
  10. /// Unpacks the size of each vector component of the copy.
  11. /// </summary>
  12. /// <returns>Vector component size</returns>
  13. public int UnpackComponentSize()
  14. {
  15. return (int)((Swizzle >> 16) & 3) + 1;
  16. }
  17. /// <summary>
  18. /// Unpacks the number of components of the source vector of the copy.
  19. /// </summary>
  20. /// <returns>Number of vector components</returns>
  21. public int UnpackSrcComponentsCount()
  22. {
  23. return (int)((Swizzle >> 20) & 7) + 1;
  24. }
  25. /// <summary>
  26. /// Unpacks the number of components of the destination vector of the copy.
  27. /// </summary>
  28. /// <returns>Number of vector components</returns>
  29. public int UnpackDstComponentsCount()
  30. {
  31. return (int)((Swizzle >> 24) & 7) + 1;
  32. }
  33. }
  34. }