diff options
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/shader_bytecode.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 61643e086..a57b90632 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -288,6 +288,19 @@ union Instruction { | |||
| 288 | } | 288 | } |
| 289 | } texs; | 289 | } texs; |
| 290 | 290 | ||
| 291 | union { | ||
| 292 | BitField<20, 5, u64> target; | ||
| 293 | BitField<5, 1, u64> constant_buffer; | ||
| 294 | |||
| 295 | s32 GetBranchTarget() const { | ||
| 296 | // Sign extend the branch target offset | ||
| 297 | u32 mask = 1U << (5 - 1); | ||
| 298 | u32 value = static_cast<u32>(target); | ||
| 299 | // The branch offset is relative to the next instruction, so add 1 to it. | ||
| 300 | return static_cast<s32>((value ^ mask) - mask) + 1; | ||
| 301 | } | ||
| 302 | } bra; | ||
| 303 | |||
| 291 | BitField<61, 1, u64> is_b_imm; | 304 | BitField<61, 1, u64> is_b_imm; |
| 292 | BitField<60, 1, u64> is_b_gpr; | 305 | BitField<60, 1, u64> is_b_gpr; |
| 293 | BitField<59, 1, u64> is_c_gpr; | 306 | BitField<59, 1, u64> is_c_gpr; |