diff options
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index f4c7e40df..4df687786 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -48,6 +48,10 @@ u32 BytesPerPixel(TextureFormat format) { | |||
| 48 | case TextureFormat::DXT1: | 48 | case TextureFormat::DXT1: |
| 49 | // In this case a 'pixel' actually refers to a 4x4 tile. | 49 | // In this case a 'pixel' actually refers to a 4x4 tile. |
| 50 | return 8; | 50 | return 8; |
| 51 | case TextureFormat::DXT23: | ||
| 52 | case TextureFormat::DXT45: | ||
| 53 | // In this case a 'pixel' actually refers to a 4x4 tile. | ||
| 54 | return 16; | ||
| 51 | case TextureFormat::A8R8G8B8: | 55 | case TextureFormat::A8R8G8B8: |
| 52 | return 4; | 56 | return 4; |
| 53 | case TextureFormat::B5G6R5: | 57 | case TextureFormat::B5G6R5: |
| @@ -67,7 +71,9 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, | |||
| 67 | 71 | ||
| 68 | switch (format) { | 72 | switch (format) { |
| 69 | case TextureFormat::DXT1: | 73 | case TextureFormat::DXT1: |
| 70 | // In the DXT1 format, each 4x4 tile is swizzled instead of just individual pixel values. | 74 | case TextureFormat::DXT23: |
| 75 | case TextureFormat::DXT45: | ||
| 76 | // In the DXT formats, each 4x4 tile is swizzled instead of just individual pixel values. | ||
| 71 | CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, | 77 | CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, |
| 72 | unswizzled_data.data(), true, block_height); | 78 | unswizzled_data.data(), true, block_height); |
| 73 | break; | 79 | break; |
| @@ -91,6 +97,8 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat | |||
| 91 | // TODO(Subv): Implement. | 97 | // TODO(Subv): Implement. |
| 92 | switch (format) { | 98 | switch (format) { |
| 93 | case TextureFormat::DXT1: | 99 | case TextureFormat::DXT1: |
| 100 | case TextureFormat::DXT23: | ||
| 101 | case TextureFormat::DXT45: | ||
| 94 | case TextureFormat::A8R8G8B8: | 102 | case TextureFormat::A8R8G8B8: |
| 95 | case TextureFormat::B5G6R5: | 103 | case TextureFormat::B5G6R5: |
| 96 | // TODO(Subv): For the time being just forward the same data without any decoding. | 104 | // TODO(Subv): For the time being just forward the same data without any decoding. |