GLCache: Added a function to convert cached PixelFormats back to texture formats.

TODO: The way we handle cached formats must change, framebuffer and texture formats are too different to keep them in the same place.
This commit is contained in:
Subv 2018-04-15 19:54:38 -05:00
parent 6b63aaa5b4
commit ac09b5a2e9
1 changed files with 12 additions and 0 deletions

View File

@ -115,6 +115,18 @@ struct SurfaceParams {
}
}
static Tegra::Texture::TextureFormat TextureFormatFromPixelFormat(PixelFormat format) {
// TODO(Subv): Properly implement this
switch (format) {
case PixelFormat::RGBA8:
return Tegra::Texture::TextureFormat::A8R8G8B8;
case PixelFormat::DXT1:
return Tegra::Texture::TextureFormat::DXT1;
default:
UNREACHABLE();
}
}
static bool CheckFormatsBlittable(PixelFormat pixel_format_a, PixelFormat pixel_format_b) {
SurfaceType a_type = GetFormatType(pixel_format_a);
SurfaceType b_type = GetFormatType(pixel_format_b);