GPU: Implemented the R8 texture format (0x1D)

This commit is contained in:
Subv 2018-05-29 21:49:37 -05:00
parent 5a763e8a5a
commit 734106dcb9
3 changed files with 18 additions and 5 deletions

View file

@ -58,6 +58,8 @@ u32 BytesPerPixel(TextureFormat format) {
case TextureFormat::A1B5G5R5:
case TextureFormat::B5G6R5:
return 2;
case TextureFormat::R8:
return 1;
default:
UNIMPLEMENTED_MSG("Format not implemented");
break;
@ -83,6 +85,7 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
case TextureFormat::A2B10G10R10:
case TextureFormat::A1B5G5R5:
case TextureFormat::B5G6R5:
case TextureFormat::R8:
CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
unswizzled_data.data(), true, block_height);
break;
@ -107,6 +110,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
case TextureFormat::A2B10G10R10:
case TextureFormat::A1B5G5R5:
case TextureFormat::B5G6R5:
case TextureFormat::R8:
// TODO(Subv): For the time being just forward the same data without any decoding.
rgba_data = texture_data;
break;