summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_interpreter.cpp
diff options
context:
space:
mode:
authorJannik Vogel <email@jannikvogel.de>2016-03-09 14:48:45 +0100
committerJannik Vogel <email@jannikvogel.de>2016-03-15 20:01:25 +0100
commit9aad2f29bb5106c840badcce8027f3e0271dfe1f (patch)
treebbe4cc86926927a1f380fb4a1a0c84ffc2836487 /src/video_core/shader/shader_interpreter.cpp
parentUpdate nihstro to latest master (diff)
downloadyuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar.gz
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar.bz2
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar.lz
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar.xz
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.tar.zst
yuzu-9aad2f29bb5106c840badcce8027f3e0271dfe1f.zip
Diffstat (limited to 'src/video_core/shader/shader_interpreter.cpp')
-rw-r--r--src/video_core/shader/shader_interpreter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index 79fcc56b9..295a2466b 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -413,9 +413,12 @@ void RunInterpreter(UnitState<Debug>& state) {
bool is_inverted = (instr.opcode.Value().EffectiveOpCode() == OpCode::Id::MADI);
+ const int address_offset = (instr.mad.address_register_index == 0)
+ ? 0 : state.address_registers[instr.mad.address_register_index - 1];
+
const float24* src1_ = LookupSourceRegister(instr.mad.GetSrc1(is_inverted));
- const float24* src2_ = LookupSourceRegister(instr.mad.GetSrc2(is_inverted));
- const float24* src3_ = LookupSourceRegister(instr.mad.GetSrc3(is_inverted));
+ const float24* src2_ = LookupSourceRegister(instr.mad.GetSrc2(is_inverted) + (!is_inverted * address_offset));
+ const float24* src3_ = LookupSourceRegister(instr.mad.GetSrc3(is_inverted) + ( is_inverted * address_offset));
const bool negate_src1 = ((bool)swizzle.negate_src1 != false);
const bool negate_src2 = ((bool)swizzle.negate_src2 != false);