diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-26 05:55:21 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-04-26 20:38:42 +0200 |
commit | c9d7abe9c9be3e3654b47623602770c9be9ee88f (patch) | |
tree | 81a6cda909f1fe18f6a5ff31321369418bd3337b /src/video_core/engines/shader_bytecode.h | |
parent | gl_shader_decompiler: Move color output to EXIT instruction. (diff) | |
download | yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar.gz yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar.bz2 yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar.lz yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar.xz yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.tar.zst yuzu-c9d7abe9c9be3e3654b47623602770c9be9ee88f.zip |
Diffstat (limited to 'src/video_core/engines/shader_bytecode.h')
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index f4d11fa5d..f3ca30cfa 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -19,7 +19,10 @@ namespace Tegra { namespace Shader { struct Register { - // Register 255 is special cased to always be 0 + /// Number of registers + static constexpr size_t NumRegisters = 256; + + /// Register 255 is special cased to always be 0 static constexpr size_t ZeroIndex = 255; constexpr Register() = default; @@ -48,6 +51,11 @@ struct Register { return ~value; } + u64 GetSwizzledIndex(u64 elem) const { + elem = (value + elem) & 3; + return (value & ~3) + elem; + } + private: u64 value{}; }; |