diff --git a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs index 97f681cf09..6b9a306355 100644 --- a/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs +++ b/Ryujinx.HLE/Gpu/Texture/TextureHelper.cs @@ -51,7 +51,7 @@ namespace Ryujinx.HLE.Gpu.Texture case GalTextureFormat.BC1: case GalTextureFormat.BC4: { - return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4); + return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 8); } case GalTextureFormat.BC7U: @@ -60,84 +60,84 @@ namespace Ryujinx.HLE.Gpu.Texture case GalTextureFormat.BC5: case GalTextureFormat.Astc2D4x4: { - return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4); + return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 16); } case GalTextureFormat.Astc2D5x5: { - return CompressedTextureSize(Texture.Width, Texture.Height, 5, 5); + return CompressedTextureSize(Texture.Width, Texture.Height, 5, 5, 16); } case GalTextureFormat.Astc2D6x6: { - return CompressedTextureSize(Texture.Width, Texture.Height, 6, 6); + return CompressedTextureSize(Texture.Width, Texture.Height, 6, 6, 16); } case GalTextureFormat.Astc2D8x8: { - return CompressedTextureSize(Texture.Width, Texture.Height, 8, 8); + return CompressedTextureSize(Texture.Width, Texture.Height, 8, 8, 16); } case GalTextureFormat.Astc2D10x10: { - return CompressedTextureSize(Texture.Width, Texture.Height, 10, 10); + return CompressedTextureSize(Texture.Width, Texture.Height, 10, 10, 16); } case GalTextureFormat.Astc2D12x12: { - return CompressedTextureSize(Texture.Width, Texture.Height, 12, 12); + return CompressedTextureSize(Texture.Width, Texture.Height, 12, 12, 16); } case GalTextureFormat.Astc2D5x4: { - return CompressedTextureSize(Texture.Width, Texture.Height, 5, 4); + return CompressedTextureSize(Texture.Width, Texture.Height, 5, 4, 16); } case GalTextureFormat.Astc2D6x5: { - return CompressedTextureSize(Texture.Width, Texture.Height, 6, 5); + return CompressedTextureSize(Texture.Width, Texture.Height, 6, 5, 16); } case GalTextureFormat.Astc2D8x6: { - return CompressedTextureSize(Texture.Width, Texture.Height, 8, 6); + return CompressedTextureSize(Texture.Width, Texture.Height, 8, 6, 16); } case GalTextureFormat.Astc2D10x8: { - return CompressedTextureSize(Texture.Width, Texture.Height, 10, 8); + return CompressedTextureSize(Texture.Width, Texture.Height, 10, 8, 16); } case GalTextureFormat.Astc2D12x10: { - return CompressedTextureSize(Texture.Width, Texture.Height, 12, 10); + return CompressedTextureSize(Texture.Width, Texture.Height, 12, 10, 16); } case GalTextureFormat.Astc2D8x5: { - return CompressedTextureSize(Texture.Width, Texture.Height, 8, 5); + return CompressedTextureSize(Texture.Width, Texture.Height, 8, 5, 16); } case GalTextureFormat.Astc2D10x5: { - return CompressedTextureSize(Texture.Width, Texture.Height, 10, 5); + return CompressedTextureSize(Texture.Width, Texture.Height, 10, 5, 16); } case GalTextureFormat.Astc2D10x6: { - return CompressedTextureSize(Texture.Width, Texture.Height, 10, 6); + return CompressedTextureSize(Texture.Width, Texture.Height, 10, 6, 16); } } throw new NotImplementedException(Texture.Format.ToString()); } - public static int CompressedTextureSize(int TextureWidth, int TextureHeight, int BlockWidth, int BlockHeight) + public static int CompressedTextureSize(int TextureWidth, int TextureHeight, int BlockWidth, int BlockHeight, int Bpb) { int W = (TextureWidth + (BlockWidth - 1)) / BlockWidth; int H = (TextureHeight + (BlockHeight - 1)) / BlockHeight; - return W * H * 16; + return W * H * Bpb; } public static (AMemory Memory, long Position) GetMemoryAndPosition(