FormatInfo.cs 814 B

12345678910111213141516171819202122232425262728293031
  1. using Ryujinx.Graphics.GAL;
  2. namespace Ryujinx.Graphics.Gpu.Image
  3. {
  4. struct FormatInfo
  5. {
  6. private static FormatInfo _rgba8 = new FormatInfo(Format.R8G8B8A8Unorm, 1, 1, 4);
  7. public static FormatInfo Default => _rgba8;
  8. public Format Format { get; }
  9. public int BlockWidth { get; }
  10. public int BlockHeight { get; }
  11. public int BytesPerPixel { get; }
  12. public bool IsCompressed => (BlockWidth | BlockHeight) != 1;
  13. public FormatInfo(
  14. Format format,
  15. int blockWidth,
  16. int blockHeight,
  17. int bytesPerPixel)
  18. {
  19. Format = format;
  20. BlockWidth = blockWidth;
  21. BlockHeight = blockHeight;
  22. BytesPerPixel = bytesPerPixel;
  23. }
  24. }
  25. }