TextureHelper.cs 685 B

1234567891011121314151617181920212223
  1. using System;
  2. namespace Ryujinx.Graphics.Gpu
  3. {
  4. static class TextureHelper
  5. {
  6. public static ISwizzle GetSwizzle(Texture Texture, int Width, int Bpp)
  7. {
  8. switch (Texture.Swizzle)
  9. {
  10. case TextureSwizzle.Pitch:
  11. case TextureSwizzle.PitchColorKey:
  12. return new LinearSwizzle(Texture.Pitch, Bpp);
  13. case TextureSwizzle.BlockLinear:
  14. case TextureSwizzle.BlockLinearColorKey:
  15. return new BlockLinearSwizzle(Width, Bpp, Texture.BlockHeight);
  16. }
  17. throw new NotImplementedException(Texture.Swizzle.ToString());
  18. }
  19. }
  20. }