summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp
index af0e13d43..6e30790bb 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp
@@ -51,6 +51,10 @@ void EmitSubgroupGeMask(EmitContext& ctx, IR::Inst& inst) {
51static void Shuffle(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index, 51static void Shuffle(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32 index,
52 const IR::Value& clamp, const IR::Value& segmentation_mask, 52 const IR::Value& clamp, const IR::Value& segmentation_mask,
53 std::string_view op) { 53 std::string_view op) {
54 IR::Inst* const in_bounds{inst.GetAssociatedPseudoOperation(IR::Opcode::GetInBoundsFromOp)};
55 if (in_bounds) {
56 in_bounds->Invalidate();
57 }
54 std::string mask; 58 std::string mask;
55 if (clamp.IsImmediate() && segmentation_mask.IsImmediate()) { 59 if (clamp.IsImmediate() && segmentation_mask.IsImmediate()) {
56 mask = fmt::to_string(clamp.U32() | (segmentation_mask.U32() << 8)); 60 mask = fmt::to_string(clamp.U32() | (segmentation_mask.U32() << 8));
@@ -61,13 +65,11 @@ static void Shuffle(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, ScalarU32
61 ScalarU32{ctx.reg_alloc.Consume(clamp)}); 65 ScalarU32{ctx.reg_alloc.Consume(clamp)});
62 } 66 }
63 const Register value_ret{ctx.reg_alloc.Define(inst)}; 67 const Register value_ret{ctx.reg_alloc.Define(inst)};
64 IR::Inst* const in_bounds{inst.GetAssociatedPseudoOperation(IR::Opcode::GetInBoundsFromOp)};
65 if (in_bounds) { 68 if (in_bounds) {
66 const Register bounds_ret{ctx.reg_alloc.Define(*in_bounds)}; 69 const Register bounds_ret{ctx.reg_alloc.Define(*in_bounds)};
67 ctx.Add("SHF{}.U {},{},{},{};" 70 ctx.Add("SHF{}.U {},{},{},{};"
68 "MOV.U {}.x,{}.y;", 71 "MOV.U {}.x,{}.y;",
69 op, bounds_ret, value, index, mask, value_ret, bounds_ret); 72 op, bounds_ret, value, index, mask, value_ret, bounds_ret);
70 in_bounds->Invalidate();
71 } else { 73 } else {
72 ctx.Add("SHF{}.U {},{},{},{};" 74 ctx.Add("SHF{}.U {},{},{},{};"
73 "MOV.U {}.x,{}.y;", 75 "MOV.U {}.x,{}.y;",