diff options
author | bunnei <bunneidev@gmail.com> | 2018-08-19 23:00:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-19 23:00:59 +0200 |
commit | 0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f (patch) | |
tree | 402efbb0dcd79c984b3256a3ddae269732b29274 | |
parent | Merge pull request #1102 from ogniK5377/mirror-clamp-edge (diff) | |
parent | Shaders/TEXS: Fixed the component mask in the TEXS instruction. (diff) | |
download | yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar.gz yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar.bz2 yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar.lz yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar.xz yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.tar.zst yuzu-0a1d4fbc5cc4ced38ee187d16e9a9d1c5a84a50f.zip |
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 8ae0e6df2..096de9632 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -12,6 +12,7 @@ #include <boost/optional.hpp> +#include "common/assert.h" #include "common/bit_field.h" #include "common/common_types.h" @@ -446,16 +447,20 @@ union Instruction { } bool IsComponentEnabled(size_t component) const { - static constexpr std::array<std::array<u32, 8>, 4> mask_lut{ - {{}, - {0x1, 0x2, 0x4, 0x8, 0x3}, - {0x1, 0x2, 0x4, 0x8, 0x3, 0x9, 0xa, 0xc}, - {0x7, 0xb, 0xd, 0xe, 0xf}}}; + static constexpr std::array<std::array<u32, 8>, 4> mask_lut{{ + {}, + {0x1, 0x2, 0x4, 0x8, 0x3, 0x9, 0xa, 0xc}, + {0x1, 0x2, 0x4, 0x8, 0x3, 0x9, 0xa, 0xc}, + {0x7, 0xb, 0xd, 0xe, 0xf}, + }}; size_t index{gpr0.Value() != Register::ZeroIndex ? 1U : 0U}; index |= gpr28.Value() != Register::ZeroIndex ? 2 : 0; - return ((1ull << component) & mask_lut[index][component_mask_selector]) != 0; + u32 mask = mask_lut[index][component_mask_selector]; + // A mask of 0 means this instruction uses an unimplemented mask. + ASSERT(mask != 0); + return ((1ull << component) & mask) != 0; } } texs; |