diff options
| author | 2018-06-02 13:17:09 -0500 | |
|---|---|---|
| committer | 2018-06-02 13:17:09 -0500 | |
| commit | 99f9d47d16aaa943d952ab4b0a46837b2685aed2 (patch) | |
| tree | 64bdd12bc324acbeb7073e688e50bf641413da40 /src/video_core/textures/decoders.cpp | |
| parent | Merge pull request #492 from mailwl/time (diff) | |
| download | yuzu-99f9d47d16aaa943d952ab4b0a46837b2685aed2.tar.gz yuzu-99f9d47d16aaa943d952ab4b0a46837b2685aed2.tar.xz yuzu-99f9d47d16aaa943d952ab4b0a46837b2685aed2.zip | |
GPU: Implemented the DXN1 (BC4) texture format.
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
| -rw-r--r-- | src/video_core/textures/decoders.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp index 0179663e8..2d2af5554 100644 --- a/src/video_core/textures/decoders.cpp +++ b/src/video_core/textures/decoders.cpp | |||
| @@ -46,6 +46,7 @@ void CopySwizzledData(u32 width, u32 height, u32 bytes_per_pixel, u32 out_bytes_ | |||
| 46 | u32 BytesPerPixel(TextureFormat format) { | 46 | u32 BytesPerPixel(TextureFormat format) { |
| 47 | switch (format) { | 47 | switch (format) { |
| 48 | case TextureFormat::DXT1: | 48 | case TextureFormat::DXT1: |
| 49 | case TextureFormat::DXN1: | ||
| 49 | // In this case a 'pixel' actually refers to a 4x4 tile. | 50 | // In this case a 'pixel' actually refers to a 4x4 tile. |
| 50 | return 8; | 51 | return 8; |
| 51 | case TextureFormat::DXT23: | 52 | case TextureFormat::DXT23: |
| @@ -79,7 +80,9 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width, | |||
| 79 | case TextureFormat::DXT1: | 80 | case TextureFormat::DXT1: |
| 80 | case TextureFormat::DXT23: | 81 | case TextureFormat::DXT23: |
| 81 | case TextureFormat::DXT45: | 82 | case TextureFormat::DXT45: |
| 82 | // In the DXT formats, each 4x4 tile is swizzled instead of just individual pixel values. | 83 | case TextureFormat::DXN1: |
| 84 | // In the DXT and DXN formats, each 4x4 tile is swizzled instead of just individual pixel | ||
| 85 | // values. | ||
| 83 | CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, | 86 | CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, |
| 84 | unswizzled_data.data(), true, block_height); | 87 | unswizzled_data.data(), true, block_height); |
| 85 | break; | 88 | break; |
| @@ -109,6 +112,7 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat | |||
| 109 | case TextureFormat::DXT1: | 112 | case TextureFormat::DXT1: |
| 110 | case TextureFormat::DXT23: | 113 | case TextureFormat::DXT23: |
| 111 | case TextureFormat::DXT45: | 114 | case TextureFormat::DXT45: |
| 115 | case TextureFormat::DXN1: | ||
| 112 | case TextureFormat::A8R8G8B8: | 116 | case TextureFormat::A8R8G8B8: |
| 113 | case TextureFormat::A2B10G10R10: | 117 | case TextureFormat::A2B10G10R10: |
| 114 | case TextureFormat::A1B5G5R5: | 118 | case TextureFormat::A1B5G5R5: |