summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar namkazy2020-04-05 15:18:42 +0700
committerGravatar namkazy2020-04-05 15:18:42 +0700
commit9f6ebccf066eb5b7c6b922dee30cf2fe6ee9d516 (patch)
treec4b53749ba26478f80c4565a0c80cc73939ee39c /src
parentshader_decode: SULD.D fix decode SNORM component (diff)
downloadyuzu-9f6ebccf066eb5b7c6b922dee30cf2fe6ee9d516.tar.gz
yuzu-9f6ebccf066eb5b7c6b922dee30cf2fe6ee9d516.tar.xz
yuzu-9f6ebccf066eb5b7c6b922dee30cf2fe6ee9d516.zip
shader_decode: SULD.D -> SINT actually same as UNORM.
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/image.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp
index efcf271dc..999cfda78 100644
--- a/src/video_core/shader/decode/image.cpp
+++ b/src/video_core/shader/decode/image.cpp
@@ -352,11 +352,13 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
352 case ComponentType::SNORM: { 352 case ComponentType::SNORM: {
353 is_signed = true; 353 is_signed = true;
354 // range [-1.0, 1.0] 354 // range [-1.0, 1.0]
355 auto cnv_value = Operation(OperationCode::FMul, original_value, Immediate(127.f)); 355 auto cnv_value =
356 Operation(OperationCode::FMul, original_value, Immediate(127.f));
356 cnv_value = SignedOperation(OperationCode::ICastFloat, is_signed, 357 cnv_value = SignedOperation(OperationCode::ICastFloat, is_signed,
357 std::move(cnv_value)); 358 std::move(cnv_value));
358 return BitfieldExtract(std::move(cnv_value), 0, 8); 359 return BitfieldExtract(std::move(cnv_value), 0, 8);
359 } 360 }
361 case ComponentType::SINT:
360 case ComponentType::UNORM: { 362 case ComponentType::UNORM: {
361 is_signed = false; 363 is_signed = false;
362 // range [0.0, 1.0] 364 // range [0.0, 1.0]
@@ -365,9 +367,6 @@ u32 ShaderIR::DecodeImage(NodeBlock& bb, u32 pc) {
365 return SignedOperation(OperationCode::ICastFloat, is_signed, 367 return SignedOperation(OperationCode::ICastFloat, is_signed,
366 std::move(cnv_value)); 368 std::move(cnv_value));
367 } 369 }
368 case ComponentType::SINT: // range [-128,127]
369 is_signed = true;
370 return original_value;
371 case ComponentType::UINT: // range [0, 255] 370 case ComponentType::UINT: // range [0, 255]
372 is_signed = false; 371 is_signed = false;
373 return original_value; 372 return original_value;