summaryrefslogtreecommitdiff
path: root/src/video_core/textures/decoders.cpp
diff options
context:
space:
mode:
authorGravatar Subv2018-03-22 16:40:11 -0500
committerGravatar Subv2018-03-24 11:31:53 -0500
commit39e60cfeb10ef317521ff1685df3d265d2c9d5ef (patch)
treef6fee21c4607642cabea7c809a10cca7aaa7c794 /src/video_core/textures/decoders.cpp
parentFrontend: Allow opening the Surface View widget in the Qt frontend. (diff)
downloadyuzu-39e60cfeb10ef317521ff1685df3d265d2c9d5ef.tar.gz
yuzu-39e60cfeb10ef317521ff1685df3d265d2c9d5ef.tar.xz
yuzu-39e60cfeb10ef317521ff1685df3d265d2c9d5ef.zip
Frontend: Updated the surface view debug widget to work with Maxwell surfaces.
Diffstat (limited to 'src/video_core/textures/decoders.cpp')
-rw-r--r--src/video_core/textures/decoders.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/video_core/textures/decoders.cpp b/src/video_core/textures/decoders.cpp
index 300267209..2e87281eb 100644
--- a/src/video_core/textures/decoders.cpp
+++ b/src/video_core/textures/decoders.cpp
@@ -48,6 +48,8 @@ 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::A8R8G8B8:
52 return 4;
51 default: 53 default:
52 UNIMPLEMENTED_MSG("Format not implemented"); 54 UNIMPLEMENTED_MSG("Format not implemented");
53 break; 55 break;
@@ -68,6 +70,10 @@ std::vector<u8> UnswizzleTexture(VAddr address, TextureFormat format, u32 width,
68 CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data, 70 CopySwizzledData(width / 4, height / 4, bytes_per_pixel, bytes_per_pixel, data,
69 unswizzled_data.data(), true, DefaultBlockHeight); 71 unswizzled_data.data(), true, DefaultBlockHeight);
70 break; 72 break;
73 case TextureFormat::A8R8G8B8:
74 CopySwizzledData(width, height, bytes_per_pixel, bytes_per_pixel, data,
75 unswizzled_data.data(), true, DefaultBlockHeight);
76 break;
71 default: 77 default:
72 UNIMPLEMENTED_MSG("Format not implemented"); 78 UNIMPLEMENTED_MSG("Format not implemented");
73 break; 79 break;
@@ -82,6 +88,11 @@ std::vector<u8> DecodeTexture(const std::vector<u8>& texture_data, TextureFormat
82 88
83 // TODO(Subv): Implement. 89 // TODO(Subv): Implement.
84 switch (format) { 90 switch (format) {
91 case TextureFormat::DXT1:
92 case TextureFormat::A8R8G8B8:
93 // TODO(Subv): For the time being just forward the same data without any decoding.
94 rgba_data = texture_data;
95 break;
85 default: 96 default:
86 UNIMPLEMENTED_MSG("Format not implemented"); 97 UNIMPLEMENTED_MSG("Format not implemented");
87 break; 98 break;