add Bpb integer argument

This commit is contained in:
greggameplayer 2018-07-11 17:28:46 +02:00 committed by GitHub
commit 30fc7ac1c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,7 +51,7 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.BC1: case GalTextureFormat.BC1:
case GalTextureFormat.BC4: case GalTextureFormat.BC4:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4); return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 8);
} }
case GalTextureFormat.BC7U: case GalTextureFormat.BC7U:
@ -60,84 +60,84 @@ namespace Ryujinx.HLE.Gpu.Texture
case GalTextureFormat.BC5: case GalTextureFormat.BC5:
case GalTextureFormat.Astc2D4x4: case GalTextureFormat.Astc2D4x4:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4); return CompressedTextureSize(Texture.Width, Texture.Height, 4, 4, 16);
} }
case GalTextureFormat.Astc2D5x5: case GalTextureFormat.Astc2D5x5:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 5, 5); return CompressedTextureSize(Texture.Width, Texture.Height, 5, 5, 16);
} }
case GalTextureFormat.Astc2D6x6: case GalTextureFormat.Astc2D6x6:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 6, 6); return CompressedTextureSize(Texture.Width, Texture.Height, 6, 6, 16);
} }
case GalTextureFormat.Astc2D8x8: case GalTextureFormat.Astc2D8x8:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 8); return CompressedTextureSize(Texture.Width, Texture.Height, 8, 8, 16);
} }
case GalTextureFormat.Astc2D10x10: case GalTextureFormat.Astc2D10x10:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 10); return CompressedTextureSize(Texture.Width, Texture.Height, 10, 10, 16);
} }
case GalTextureFormat.Astc2D12x12: case GalTextureFormat.Astc2D12x12:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 12, 12); return CompressedTextureSize(Texture.Width, Texture.Height, 12, 12, 16);
} }
case GalTextureFormat.Astc2D5x4: case GalTextureFormat.Astc2D5x4:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 5, 4); return CompressedTextureSize(Texture.Width, Texture.Height, 5, 4, 16);
} }
case GalTextureFormat.Astc2D6x5: case GalTextureFormat.Astc2D6x5:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 6, 5); return CompressedTextureSize(Texture.Width, Texture.Height, 6, 5, 16);
} }
case GalTextureFormat.Astc2D8x6: case GalTextureFormat.Astc2D8x6:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 6); return CompressedTextureSize(Texture.Width, Texture.Height, 8, 6, 16);
} }
case GalTextureFormat.Astc2D10x8: case GalTextureFormat.Astc2D10x8:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 8); return CompressedTextureSize(Texture.Width, Texture.Height, 10, 8, 16);
} }
case GalTextureFormat.Astc2D12x10: case GalTextureFormat.Astc2D12x10:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 12, 10); return CompressedTextureSize(Texture.Width, Texture.Height, 12, 10, 16);
} }
case GalTextureFormat.Astc2D8x5: case GalTextureFormat.Astc2D8x5:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 8, 5); return CompressedTextureSize(Texture.Width, Texture.Height, 8, 5, 16);
} }
case GalTextureFormat.Astc2D10x5: case GalTextureFormat.Astc2D10x5:
{ {
return CompressedTextureSize(Texture.Width, Texture.Height, 10, 5); return CompressedTextureSize(Texture.Width, Texture.Height, 10, 5, 16);
} }
case GalTextureFormat.Astc2D10x6: 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()); 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 W = (TextureWidth + (BlockWidth - 1)) / BlockWidth;
int H = (TextureHeight + (BlockHeight - 1)) / BlockHeight; int H = (TextureHeight + (BlockHeight - 1)) / BlockHeight;
return W * H * 16; return W * H * Bpb;
} }
public static (AMemory Memory, long Position) GetMemoryAndPosition( public static (AMemory Memory, long Position) GetMemoryAndPosition(