summaryrefslogtreecommitdiff
path: root/src/video_core/debug_utils
diff options
context:
space:
mode:
authorGravatar Tony Wasserka2014-12-21 02:51:48 +0100
committerGravatar Tony Wasserka2014-12-31 15:35:24 +0100
commit632655e292cc317f8a985747dda8883d3f785431 (patch)
treec348ea586a5203c3f3a1e844c43bd94ce64f9d15 /src/video_core/debug_utils
parentPica/CommandProcessor: Add support for integer uniforms. (diff)
downloadyuzu-632655e292cc317f8a985747dda8883d3f785431.tar.gz
yuzu-632655e292cc317f8a985747dda8883d3f785431.tar.xz
yuzu-632655e292cc317f8a985747dda8883d3f785431.zip
Pica: Fix A4, IA4 and IA8 texture formats.
Both IA4 and IA8 had their component order mixed up. Additionally, IA4 used the wrong number of nibbles per texel. A4 skipped every second texel.
Diffstat (limited to 'src/video_core/debug_utils')
-rw-r--r--src/video_core/debug_utils/debug_utils.cpp20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp
index 5921185a6..9c0fbc453 100644
--- a/src/video_core/debug_utils/debug_utils.cpp
+++ b/src/video_core/debug_utils/debug_utils.cpp
@@ -389,13 +389,11 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
389 { 389 {
390 const u8* source_ptr = source + offset * 2; 390 const u8* source_ptr = source + offset * 2;
391 391
392 // TODO: component order not verified
393
394 if (disable_alpha) { 392 if (disable_alpha) {
395 // Show intensity as red, alpha as green 393 // Show intensity as red, alpha as green
396 return { source_ptr[0], source_ptr[1], 0, 255 }; 394 return { source_ptr[1], source_ptr[0], 0, 255 };
397 } else { 395 } else {
398 return { source_ptr[0], source_ptr[0], source_ptr[0], source_ptr[1]}; 396 return { source_ptr[1], source_ptr[1], source_ptr[1], source_ptr[0]};
399 } 397 }
400 } 398 }
401 399
@@ -418,12 +416,10 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
418 416
419 case Regs::TextureFormat::IA4: 417 case Regs::TextureFormat::IA4:
420 { 418 {
421 const u8* source_ptr = source + offset / 2; 419 const u8* source_ptr = source + offset;
422
423 // TODO: component order not verified
424 420
425 u8 i = (*source_ptr) & 0xF; 421 u8 i = ((*source_ptr) & 0xF0) >> 4;
426 u8 a = ((*source_ptr) & 0xF0) >> 4; 422 u8 a = (*source_ptr) & 0xF;
427 a |= a << 4; 423 a |= a << 4;
428 i |= i << 4; 424 i |= i << 4;
429 425
@@ -439,15 +435,13 @@ const Math::Vec4<u8> LookupTexture(const u8* source, int x, int y, const Texture
439 { 435 {
440 const u8* source_ptr = source + offset / 2; 436 const u8* source_ptr = source + offset / 2;
441 437
442 // TODO: component order not verified
443
444 u8 a = (coarse_x % 2) ? ((*source_ptr)&0xF) : (((*source_ptr) & 0xF0) >> 4); 438 u8 a = (coarse_x % 2) ? ((*source_ptr)&0xF) : (((*source_ptr) & 0xF0) >> 4);
445 a |= a << 4; 439 a |= a << 4;
446 440
447 if (disable_alpha) { 441 if (disable_alpha) {
448 return { *source_ptr, *source_ptr, *source_ptr, 255 }; 442 return { a, a, a, 255 };
449 } else { 443 } else {
450 return { 0, 0, 0, *source_ptr }; 444 return { 0, 0, 0, a };
451 } 445 }
452 } 446 }
453 447