diff options
| author | 2021-05-19 01:00:51 -0400 | |
|---|---|---|
| committer | 2021-07-22 21:51:33 -0400 | |
| commit | 36d040da7059e438fa35f1a5de5d5aed4cef5ca4 (patch) | |
| tree | 304f0b94407b689627c4966212c06dc3e8ad65d5 /src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | |
| parent | glasm: Implement PrimitiveId attribute read (diff) | |
| download | yuzu-36d040da7059e438fa35f1a5de5d5aed4cef5ca4.tar.gz yuzu-36d040da7059e438fa35f1a5de5d5aed4cef5ca4.tar.xz yuzu-36d040da7059e438fa35f1a5de5d5aed4cef5ca4.zip | |
glasm: Implement FSWZADD
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | 13 |
1 files changed, 11 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 0f987daeb..af0e13d43 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_warp.cpp | |||
| @@ -95,8 +95,17 @@ void EmitShuffleButterfly(EmitContext& ctx, IR::Inst& inst, ScalarU32 value, Sca | |||
| 95 | Shuffle(ctx, inst, value, index, clamp, segmentation_mask, "XOR"); | 95 | Shuffle(ctx, inst, value, index, clamp, segmentation_mask, "XOR"); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | void EmitFSwizzleAdd(EmitContext&, ScalarF32, ScalarF32, ScalarU32) { | 98 | void EmitFSwizzleAdd(EmitContext& ctx, IR::Inst& inst, ScalarF32 op_a, ScalarF32 op_b, |
| 99 | throw NotImplementedException("GLASM instruction"); | 99 | ScalarU32 swizzle) { |
| 100 | const auto ret{ctx.reg_alloc.Define(inst)}; | ||
| 101 | ctx.Add("AND.U RC.z,{}.threadid,3;" | ||
| 102 | "SHL.U RC.z,RC.z,1;" | ||
| 103 | "SHR.U RC.z,{},RC.z;" | ||
| 104 | "AND.U RC.z,RC.z,3;" | ||
| 105 | "MUL.F RC.x,{},FSWZA[RC.z];" | ||
| 106 | "MUL.F RC.y,{},FSWZB[RC.z];" | ||
| 107 | "ADD.F {}.x,RC.x,RC.y;", | ||
| 108 | ctx.stage_name, swizzle, op_a, op_b, ret); | ||
| 100 | } | 109 | } |
| 101 | 110 | ||
| 102 | void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { | 111 | void EmitDPdxFine(EmitContext& ctx, IR::Inst& inst, ScalarF32 p) { |