diff options
| author | 2021-05-20 20:36:04 -0300 | |
|---|---|---|
| committer | 2021-07-22 21:51:32 -0400 | |
| commit | d5db96386d08652a8fd90757d9933835c06a84d6 (patch) | |
| tree | 5ec65d0e1fb181d1a9e6e05be5c56869bbae9f00 /src/shader_recompiler/backend/glasm | |
| parent | glasm: Optimize EmitVertex into EMIT (diff) | |
| download | yuzu-d5db96386d08652a8fd90757d9933835c06a84d6.tar.gz yuzu-d5db96386d08652a8fd90757d9933835c06a84d6.tar.xz yuzu-d5db96386d08652a8fd90757d9933835c06a84d6.zip | |
glasm: Implement InvocationId
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 3 | ||||
| -rw-r--r-- | src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index d8451b41f..7b25fa042 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp | |||
| @@ -77,6 +77,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile | |||
| 77 | if (stage == Stage::Geometry && info.loads_position) { | 77 | if (stage == Stage::Geometry && info.loads_position) { |
| 78 | Add("ATTRIB vertex_position=vertex.position;"); | 78 | Add("ATTRIB vertex_position=vertex.position;"); |
| 79 | } | 79 | } |
| 80 | if (info.uses_invocation_id) { | ||
| 81 | Add("ATTRIB primitive_invocation=primitive.invocation;"); | ||
| 82 | } | ||
| 80 | for (size_t index = 0; index < program.info.stores_frag_color.size(); ++index) { | 83 | for (size_t index = 0; index < program.info.stores_frag_color.size(); ++index) { |
| 81 | if (!program.info.stores_frag_color[index]) { | 84 | if (!program.info.stores_frag_color[index]) { |
| 82 | continue; | 85 | continue; |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp index 82abbdab3..b60c907df 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -160,8 +160,8 @@ void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst) { | |||
| 160 | ctx.Add("MOV.S {},invocation.localid;", inst); | 160 | ctx.Add("MOV.S {},invocation.localid;", inst); |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | void EmitInvocationId(EmitContext& ctx) { | 163 | void EmitInvocationId(EmitContext& ctx, IR::Inst& inst) { |
| 164 | NotImplemented(); | 164 | ctx.Add("MOV.S {}.x,primitive_invocation.x;", inst); |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | void EmitSampleId(EmitContext& ctx) { | 167 | void EmitSampleId(EmitContext& ctx) { |