diff options
| author | 2018-04-18 20:20:51 -0400 | |
|---|---|---|
| committer | 2018-04-18 20:20:51 -0400 | |
| commit | 60e6e8953ef764eb2db46d336623831e6f0cc193 (patch) | |
| tree | 35588db31eb7b9cfe98954c214dbb14df42e8ac2 /src/video_core/textures | |
| parent | gl_shader_gen: Support vertical/horizontal viewport flipping. (#347) (diff) | |
| parent | GPU: Implemented the B5G6R5 format. (diff) | |
| download | yuzu-60e6e8953ef764eb2db46d336623831e6f0cc193.tar.gz yuzu-60e6e8953ef764eb2db46d336623831e6f0cc193.tar.xz yuzu-60e6e8953ef764eb2db46d336623831e6f0cc193.zip | |
Merge pull request #351 from Subv/tex_formats
GPU: Implemented the B5G6R5 format.
Diffstat (limited to 'src/video_core/textures')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/textures/texture.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 9c2a10d2e..f4c7e40df 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -50,6 +50,8 @@ u32 BytesPerPixel(TextureFormat format) { | |||
| 50 | return 8; | 50 | return 8; |
| 51 | case TextureFormat::A8R8G8B8: | 51 | case TextureFormat::A8R8G8B8: |
| 52 | return 4; | 52 | return 4; |
| 53 | case TextureFormat::B5G6R5: | ||
| 54 | return 2; | ||
| 53 | default: | 55 | default: |
| 54 | UNIMPLEMENTED_MSG("Format not implemented"); | 56 | UNIMPLEMENTED_MSG("Format not implemented"); |
| 55 | break; | 57 | break; |
| @@ -70,6 +72,7 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, | |||
| 70 | unswizzled_data.data(), true, block_height); | 72 | unswizzled_data.data(), true, block_height); |
| 71 | break; | 73 | break; |
| 72 | case TextureFormat::A8R8G8B8: | 74 | case TextureFormat::A8R8G8B8: |
| 75 | case TextureFormat::B5G6R5: | ||
| 73 | CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, | 76 | CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data, |
| 74 | unswizzled_data.data(), true, block_height); | 77 | unswizzled_data.data(), true, block_height); |
| 75 | break; | 78 | break; |
| @@ -89,6 +92,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat | |||
| 89 | switch (format) { | 92 | switch (format) { |
| 90 | case TextureFormat::DXT1: | 93 | case TextureFormat::DXT1: |
| 91 | case TextureFormat::A8R8G8B8: | 94 | case TextureFormat::A8R8G8B8: |
| 95 | case TextureFormat::B5G6R5: | ||
| 92 | // TODO(Subv): For the time being just forward the same data without any decoding. | 96 | // TODO(Subv): For the time being just forward the same data without any decoding. |
| 93 | rgba_data = texture_data; | 97 | rgba_data = texture_data; |
| 94 | break; | 98 | break; |
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h index 09d2317e0..86e45aa88 100644 --- a/src/video_core/textures/texture.h +++ b/src/video_core/textures/texture.h | |||
| @@ -15,6 +15,7 @@ namespace Texture { | |||
| 15 | 15 | ||
| 16 | enum class TextureFormat : u32 { | 16 | enum class TextureFormat : u32 { |
| 17 | A8R8G8B8 = 0x8, | 17 | A8R8G8B8 = 0x8, |
| 18 | B5G6R5 = 0x15, | ||
| 18 | DXT1 = 0x24, | 19 | DXT1 = 0x24, |
| 19 | DXT23 = 0x25, | 20 | DXT23 = 0x25, |
| 20 | DXT45 = 0x26, | 21 | DXT45 = 0x26, |