CopyBufferSwizzle.cs 1.1 KB

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