summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoraroulin <andy.roulin@epfl.ch>2015-08-16 11:51:21 +0200
committeraroulin <andy.roulin@epfl.ch>2015-08-16 15:54:30 +0200
commit638e47c04dca31c3434f88fccef8cc61315b6adf (patch)
tree5201fd9d4f318b04d5b0049fc79747656f27813e /src
parentBuild fix for Debug configurations. (diff)
downloadyuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar.gz
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar.bz2
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar.lz
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar.xz
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.tar.zst
yuzu-638e47c04dca31c3434f88fccef8cc61315b6adf.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/shader/shader_interpreter.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index e14de0768..646171a19 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -334,6 +334,42 @@ void RunInterpreter(UnitState<Debug>& state) {
Record<DebugDataRecord::CMP_RESULT>(state.debug, iteration, state.conditional_code);
break;
+ case OpCode::Id::EX2:
+ {
+ Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
+ Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
+
+ // EX2 only takes first component exp2 and writes it to all dest components
+ float24 ex2_res = float24::FromFloat32(std::exp2(src1[0].ToFloat32()));
+ for (int i = 0; i < 4; ++i) {
+ if (!swizzle.DestComponentEnabled(i))
+ continue;
+
+ dest[i] = ex2_res;
+ }
+
+ Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
+ break;
+ }
+
+ case OpCode::Id::LG2:
+ {
+ Record<DebugDataRecord::SRC1>(state.debug, iteration, src1);
+ Record<DebugDataRecord::DEST_IN>(state.debug, iteration, dest);
+
+ // LG2 only takes the first component log2 and writes it to all dest components
+ float24 lg2_res = float24::FromFloat32(std::log2(src1[0].ToFloat32()));
+ for (int i = 0; i < 4; ++i) {
+ if (!swizzle.DestComponentEnabled(i))
+ continue;
+
+ dest[i] = lg2_res;
+ }
+
+ Record<DebugDataRecord::DEST_OUT>(state.debug, iteration, dest);
+ break;
+ }
+
default:
LOG_ERROR(HW_GPU, "Unhandled arithmetic instruction: 0x%02x (%s): 0x%08x",
(int)instr.opcode.Value().EffectiveOpCode(), instr.opcode.Value().GetInfo().name, instr.hex);