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.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.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 4fc7d2f2f..f110fd7f8 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -281,7 +281,8 @@ void SetupOptions(const IR::Program& program, const Profile& profile, std::strin | |||
| 281 | if (info.uses_atomic_f16x2_add || info.uses_atomic_f16x2_min || info.uses_atomic_f16x2_max) { | 281 | if (info.uses_atomic_f16x2_add || info.uses_atomic_f16x2_min || info.uses_atomic_f16x2_max) { |
| 282 | header += "OPTION NV_shader_atomic_fp16_vector;"; | 282 | header += "OPTION NV_shader_atomic_fp16_vector;"; |
| 283 | } | 283 | } |
| 284 | if (info.uses_subgroup_invocation_id || info.uses_subgroup_mask || info.uses_subgroup_vote) { | 284 | if (info.uses_subgroup_invocation_id || info.uses_subgroup_mask || info.uses_subgroup_vote || |
| 285 | info.uses_fswzadd) { | ||
| 285 | header += "OPTION NV_shader_thread_group;"; | 286 | header += "OPTION NV_shader_thread_group;"; |
| 286 | } | 287 | } |
| 287 | if (info.uses_subgroup_shuffles) { | 288 | if (info.uses_subgroup_shuffles) { |
| @@ -416,12 +417,25 @@ std::string EmitGLASM(const Profile& profile, IR::Program& program, Bindings& bi | |||
| 416 | if (program.local_memory_size > 0) { | 417 | if (program.local_memory_size > 0) { |
| 417 | header += fmt::format("lmem[{}],", program.local_memory_size); | 418 | header += fmt::format("lmem[{}],", program.local_memory_size); |
| 418 | } | 419 | } |
| 420 | if (program.info.uses_fswzadd) { | ||
| 421 | header += "FSWZA[4],FSWZB[4],"; | ||
| 422 | } | ||
| 419 | header += "RC;" | 423 | header += "RC;" |
| 420 | "LONG TEMP "; | 424 | "LONG TEMP "; |
| 421 | for (size_t index = 0; index < ctx.reg_alloc.NumUsedLongRegisters(); ++index) { | 425 | for (size_t index = 0; index < ctx.reg_alloc.NumUsedLongRegisters(); ++index) { |
| 422 | header += fmt::format("D{},", index); | 426 | header += fmt::format("D{},", index); |
| 423 | } | 427 | } |
| 424 | header += "DC;"; | 428 | header += "DC;"; |
| 429 | if (program.info.uses_fswzadd) { | ||
| 430 | header += "MOV.F FSWZA[0],-1;" | ||
| 431 | "MOV.F FSWZA[1],1;" | ||
| 432 | "MOV.F FSWZA[2],-1;" | ||
| 433 | "MOV.F FSWZA[3],0;" | ||
| 434 | "MOV.F FSWZB[0],-1;" | ||
| 435 | "MOV.F FSWZB[1],-1;" | ||
| 436 | "MOV.F FSWZB[2],1;" | ||
| 437 | "MOV.F FSWZB[3],-1;"; | ||
| 438 | } | ||
| 425 | ctx.code.insert(0, header); | 439 | ctx.code.insert(0, header); |
| 426 | ctx.code += "END"; | 440 | ctx.code += "END"; |
| 427 | return ctx.code; | 441 | return ctx.code; |