From bf1174c114650110ac50175a804fcc3336b8fe33 Mon Sep 17 00:00:00 2001 From: Nguyen Dac Nam Date: Tue, 7 Apr 2020 07:55:49 +0700 Subject: Apply suggestions from code review Co-Authored-By: Rodrigo Locatti --- src/video_core/shader/decode/image.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/video_core') 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) { case TextureFormat::R16_G16_B16_A16: return 16; case TextureFormat::R32_G32_B32: - return (component == 0 || component == 1 || component == 2) ? 32 : 0; + return component <= 2 ? 32 : 0; case TextureFormat::R32_G32: - return (component == 0 || component == 1) ? 32 : 0; + return component <= 1 ? 32 : 0; case TextureFormat::R16_G16: - return (component == 0 || component == 1) ? 16 : 0; + return component <= 1 ? 16 : 0; case TextureFormat::R32: - return (component == 0) ? 32 : 0; + return component == 0 ? 32 : 0; case TextureFormat::R16: - return (component == 0) ? 16 : 0; + return component == 0 ? 16 : 0; case TextureFormat::R8: - return (component == 0) ? 8 : 0; + return component == 0 ? 8 : 0; case TextureFormat::R1: - return (component == 0) ? 1 : 0; + return component == 0 ? 1 : 0; case TextureFormat::A8R8G8B8: return 8; case TextureFormat::A2B10G10R10: @@ -296,11 +296,11 @@ std::pair ShaderIR::GetComponentValue(ComponentType component_type, if (component_size == 16) { return {Operation(OperationCode::HCastFloat, original_value), true}; } else { - return {original_value, true}; + return {std::move(original_value), true}; } default: UNIMPLEMENTED_MSG("Unimplement component type={}", component_type); - return {original_value, true}; + return {std::move(original_value), true}; } } -- cgit v1.2.3