summaryrefslogtreecommitdiff
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2019-08-31 17:06:00 -0300
committerGravatar ReinUsesLisp2019-09-04 01:55:24 -0300
commit77ef4fa9078b56c3fcaded3a618cf95fe21e66d4 (patch)
tree7d21a7ab8db5c806f93f4d345a887e4f1d2c7a2f /src/video_core/engines
parentMerge pull request #2835 from chris062689/master (diff)
downloadyuzu-77ef4fa9078b56c3fcaded3a618cf95fe21e66d4.tar.gz
yuzu-77ef4fa9078b56c3fcaded3a618cf95fe21e66d4.tar.xz
yuzu-77ef4fa9078b56c3fcaded3a618cf95fe21e66d4.zip
shader/shift: Implement SHR wrapped and clamped variants
Nvidia defaults to wrapped shifts, but this is undefined behaviour on OpenGL's spec. Explicitly mask/clamp according to what the guest shader requires.
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/shader_bytecode.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index c3678b9ea..bd8c1ada0 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -675,6 +675,10 @@ union Instruction {
675 } shift; 675 } shift;
676 676
677 union { 677 union {
678 BitField<39, 1, u64> wrap;
679 } shr;
680
681 union {
678 BitField<39, 5, u64> shift_amount; 682 BitField<39, 5, u64> shift_amount;
679 BitField<48, 1, u64> negate_b; 683 BitField<48, 1, u64> negate_b;
680 BitField<49, 1, u64> negate_a; 684 BitField<49, 1, u64> negate_a;