summaryrefslogtreecommitdiffstats
path: root/src/video_core
diff options
context:
space:
mode:
authorSubv <subv2112@gmail.com>2018-06-05 05:56:28 +0200
committerSubv <subv2112@gmail.com>2018-06-05 05:56:28 +0200
commite7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9 (patch)
treec53ffcd6a965b7483ec5013c505a963071cf7437 /src/video_core
parentMerge pull request #518 from Subv/incomplete_shaders (diff)
downloadyuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar.gz
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar.bz2
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar.lz
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar.xz
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.tar.zst
yuzu-e7dfcdde74e0dfdb3c8da097201d90cbc48c7ff9.zip
Diffstat (limited to 'src/video_core')
-rw-r--r--src/video_core/engines/shader_bytecode.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 8d4ea3401..edb491464 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -328,15 +328,16 @@ union Instruction {
} texs;
union {
- BitField<20, 5, u64> target;
+ BitField<20, 24, u64> target;
BitField<5, 1, u64> constant_buffer;
s32 GetBranchTarget() const {
// Sign extend the branch target offset
- u32 mask = 1U << (5 - 1);
+ u32 mask = 1U << (24 - 1);
u32 value = static_cast<u32>(target);
- // The branch offset is relative to the next instruction, so add 1 to it.
- return static_cast<s32>((value ^ mask) - mask) + 1;
+ // The branch offset is relative to the next instruction and is stored in bytes, so
+ // divide it by the size of an instruction and add 1 to it.
+ return static_cast<s32>((value ^ mask) - mask) / sizeof(Instruction) + 1;
}
} bra;