diff options
| author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-12-05 16:58:18 -0500 |
|---|---|---|
| committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-12-05 18:11:19 -0500 |
| commit | 1e1f7b32341f6538fce07d0df415a4d494a2b209 (patch) | |
| tree | 4c19b5ce70e2bf75527b08966e6b2ebc8aa0b48c /src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | |
| parent | f32b2bcd200097659d7c6e0dfdef1e96e3f2f69e (diff) | |
glasm: Move implemented instructions from not_implemented.cpp
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_context_get_set.cpp | 29 |
1 files changed, 29 insertions, 0 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 1b98e5b6c..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 @@ -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); } |
