diff options
author | Nguyen Dac Nam <nam.kazt.91@gmail.com> | 2020-04-07 02:55:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-07 02:55:49 +0200 |
commit | bf1174c114650110ac50175a804fcc3336b8fe33 (patch) | |
tree | 5fa99560e115490e642fe4a5d1369a380c5c2edb /src/video_core/shader | |
parent | shader_decode: SULD.D using std::pair instead of out parameter (diff) | |
download | yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.gz yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.bz2 yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.lz yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.xz yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.tar.zst yuzu-bf1174c114650110ac50175a804fcc3336b8fe33.zip |
Diffstat (limited to 'src/video_core/shader')
-rw-r--r-- | src/video_core/shader/decode/image.cpp | 18 |
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) { 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<Node, bool> 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}; } } |