summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Nguyen Dac Nam2020-04-07 07:55:49 +0700
committerGravatar GitHub2020-04-07 07:55:49 +0700
commitbf1174c114650110ac50175a804fcc3336b8fe33 (patch)
tree5fa99560e115490e642fe4a5d1369a380c5c2edb /src
parentshader_decode: SULD.D using std::pair instead of out parameter (diff)
downloadyuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.gz
yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.xz
yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.zip
Apply suggestions from code review
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/decode/image.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/video_core/shader/decode/image.cpp b/src/video_core/shader/decode/image.cpp
index 7ad908a0e..4e796c79c 100644
--- a/src/video_core/shader/decode/image.cpp
+++ b/src/video_core/shader/decode/image.cpp
@@ -141,19 +141,19 @@ u32 GetComponentSize(TextureFormat format, std::size_t component) {
141 case TextureFormat::R16_G16_B16_A16: 141 case TextureFormat::R16_G16_B16_A16:
142 return 16; 142 return 16;
143 case TextureFormat::R32_G32_B32: 143 case TextureFormat::R32_G32_B32:
144 return (component == 0 || component == 1 || component == 2) ? 32 : 0; 144 return component <= 2 ? 32 : 0;
145 case TextureFormat::R32_G32: 145 case TextureFormat::R32_G32:
146 return (component == 0 || component == 1) ? 32 : 0; 146 return component <= 1 ? 32 : 0;
147 case TextureFormat::R16_G16: 147 case TextureFormat::R16_G16:
148 return (component == 0 || component == 1) ? 16 : 0; 148 return component <= 1 ? 16 : 0;
149 case TextureFormat::R32: 149 case TextureFormat::R32:
150 return (component == 0) ? 32 : 0; 150 return component == 0 ? 32 : 0;
151 case TextureFormat::R16: 151 case TextureFormat::R16:
152 return (component == 0) ? 16 : 0; 152 return component == 0 ? 16 : 0;
153 case TextureFormat::R8: 153 case TextureFormat::R8:
154 return (component == 0) ? 8 : 0; 154 return component == 0 ? 8 : 0;
155 case TextureFormat::R1: 155 case TextureFormat::R1:
156 return (component == 0) ? 1 : 0; 156 return component == 0 ? 1 : 0;
157 case TextureFormat::A8R8G8B8: 157 case TextureFormat::A8R8G8B8:
158 return 8; 158 return 8;
159 case TextureFormat::A2B10G10R10: 159 case TextureFormat::A2B10G10R10:
@@ -296,11 +296,11 @@ std::pair<Node, bool> ShaderIR::GetComponentValue(ComponentType component_type,
296 if (component_size == 16) { 296 if (component_size == 16) {
297 return {Operation(OperationCode::HCastFloat, original_value), true}; 297 return {Operation(OperationCode::HCastFloat, original_value), true};
298 } else { 298 } else {
299 return {original_value, true}; 299 return {std::move(original_value), true};
300 } 300 }
301 default: 301 default:
302 UNIMPLEMENTED_MSG("Unimplement component type={}", component_type); 302 UNIMPLEMENTED_MSG("Unimplement component type={}", component_type);
303 return {original_value, true}; 303 return {std::move(original_value), true};
304 } 304 }
305} 305}
306 306