diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-16 02:45:56 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-04-17 22:36:42 +0200 |
commit | 5a28dce9eb8db4571cc47352174c78f2c3cfd606 (patch) | |
tree | f879ecc81cb6737df1e2e0adea45acf53cba1e1e /src/video_core/engines/shader_bytecode.h | |
parent | gl_shader_decompiler: Allow vertex position to be used in fragment shader. (diff) | |
download | yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar.gz yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar.bz2 yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar.lz yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar.xz yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.tar.zst yuzu-5a28dce9eb8db4571cc47352174c78f2c3cfd606.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 51cf4af9f..c368fa7fd 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -4,6 +4,7 @@ #pragma once +#include <cstring> #include <map> #include <string> #include "common/bit_field.h" @@ -289,6 +290,7 @@ enum class SubOp : u64 { Lg2 = 0x3, Rcp = 0x4, Rsq = 0x5, + Min = 0x8, }; union Instruction { @@ -307,11 +309,22 @@ union Instruction { BitField<39, 8, Register> gpr39; union { + BitField<20, 19, u64> imm20; BitField<45, 1, u64> negate_b; BitField<46, 1, u64> abs_a; BitField<48, 1, u64> negate_a; BitField<49, 1, u64> abs_b; BitField<50, 1, u64> abs_d; + BitField<56, 1, u64> negate_imm; + + float GetImm20() const { + float result{}; + u32 imm{static_cast<u32>(imm20)}; + imm <<= 12; + imm |= negate_imm ? 0x80000000 : 0; + std::memcpy(&result, &imm, sizeof(imm)); + return result; + } } alu; union { @@ -319,6 +332,7 @@ union Instruction { BitField<49, 1, u64> negate_c; } ffma; + BitField<61, 1, u64> is_b_imm; BitField<60, 1, u64> is_b_gpr; BitField<59, 1, u64> is_c_gpr; |