diff options
author | Mai M <mathew1800@gmail.com> | 2021-12-08 00:27:50 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-08 00:27:50 +0100 |
commit | edbde7a2204cddaa48c2964eb66198639d17db2f (patch) | |
tree | cfcfa1e39ab647e96c53541fc47c762e42d4f1fe /src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | |
parent | Merge pull request #7526 from Void48/patch-1 (diff) | |
parent | emit_spirv: Reduce emit_spirv.h include overhead (diff) | |
download | yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar.gz yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar.bz2 yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar.lz yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar.xz yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.tar.zst yuzu-edbde7a2204cddaa48c2964eb66198639d17db2f.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp index 02c9dc6d7..081b2c8e0 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp @@ -4,8 +4,8 @@ #include <string_view> -#include "shader_recompiler/backend/glasm/emit_context.h" #include "shader_recompiler/backend/glasm/emit_glasm_instructions.h" +#include "shader_recompiler/backend/glasm/glasm_emit_context.h" #include "shader_recompiler/frontend/ir/value.h" #include "shader_recompiler/profile.h" #include "shader_recompiler/shader_info.h" @@ -335,6 +335,35 @@ void EmitSetFragDepth(EmitContext& ctx, ScalarF32 value) { ctx.Add("MOV.F result.depth.z,{};", value); } +void EmitWorkgroupId(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.S {},invocation.groupid;", inst); +} + +void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.S {},invocation.localid;", inst); +} + +void EmitInvocationId(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.S {}.x,primitive_invocation.x;", inst); +} + +void EmitSampleId(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.S {}.x,fragment.sampleid.x;", inst); +} + +void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.S {}.x,fragment.helperthread.x;", inst); +} + +void EmitYDirection(EmitContext& ctx, IR::Inst& inst) { + ctx.uses_y_direction = true; + ctx.Add("MOV.F {}.x,y_direction[0].w;", inst); +} + +void EmitResolutionDownFactor(EmitContext& ctx, IR::Inst& inst) { + ctx.Add("MOV.F {}.x,scaling[0].z;", inst); +} + void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, ScalarU32 word_offset) { ctx.Add("MOV.U {},lmem[{}].x;", inst, word_offset); } |