summaryrefslogtreecommitdiffstats
path: root/src/video_core/textures
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-04-19 03:48:53 +0200
committerSubv <subv2112@gmail.com>2018-04-19 03:48:53 +0200
commit057170928ce71fb262d4d9969b7889971dc7232a (patch)
tree13c219cf533d215e6f20ce47a3ea92465974fd98 /src/video_core/textures
parentMerge pull request #351 from Subv/tex_formats (diff)
downloadyuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar.gz
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar.bz2
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar.lz
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar.xz
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.tar.zst
yuzu-057170928ce71fb262d4d9969b7889971dc7232a.zip
Diffstat (limited to 'src/video_core/textures')
-rw-r--r--src/video_core/textures/decoders.cpp10
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) {
case TextureFormat::DXT1:
// In this case a 'pixel' actually refers to a 4x4 tile.
return 8;
+ case TextureFormat::DXT23:
+ case TextureFormat::DXT45:
+ // In this case a 'pixel' actually refers to a 4x4 tile.
+ return 16;
case TextureFormat::A8R8G8B8:
return 4;
case TextureFormat::B5G6R5:
@@ -67,7 +71,9 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
switch (format) {
case TextureFormat::DXT1:
- // In the DXT1 format, each 4x4 tile is swizzled instead of just individual pixel values.
+ case TextureFormat::DXT23:
+ case TextureFormat::DXT45:
+ // In the DXT formats, each 4x4 tile is swizzled instead of just individual pixel values.
CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data,
unswizzled_data.data(), true, block_height);
break;
@@ -91,6 +97,8 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
// TODO(Subv): Implement.
switch (format) {
case TextureFormat::DXT1:
+ case TextureFormat::DXT23:
+ case TextureFormat::DXT45:
case TextureFormat::A8R8G8B8:
case TextureFormat::B5G6R5:
// TODO(Subv): For the time being just forward the same data without any decoding.