diff options
Diffstat (limited to 'src/shader_recompiler/backend/glasm')
4 files changed, 9 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.h b/src/shader_recompiler/backend/glasm/emit_context.h index 057d74790..cd4213cb7 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.h +++ b/src/shader_recompiler/backend/glasm/emit_context.h | |||
| @@ -70,6 +70,8 @@ public: | |||
| 70 | Stage stage{}; | 70 | Stage stage{}; |
| 71 | std::string_view stage_name = "invalid"; | 71 | std::string_view stage_name = "invalid"; |
| 72 | std::string_view attrib_name = "invalid"; | 72 | std::string_view attrib_name = "invalid"; |
| 73 | |||
| 74 | bool uses_y_direction{}; | ||
| 73 | }; | 75 | }; |
| 74 | 76 | ||
| 75 | } // namespace Shader::Backend::GLASM | 77 | } // namespace Shader::Backend::GLASM |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp index 4f838b699..2a0524609 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp | |||
| @@ -439,6 +439,9 @@ std::string EmitGLASM(const Profile& profile, const RuntimeInfo& runtime_info, I | |||
| 439 | "MOV.F FSWZB[2],1;" | 439 | "MOV.F FSWZB[2],1;" |
| 440 | "MOV.F FSWZB[3],-1;"; | 440 | "MOV.F FSWZB[3],-1;"; |
| 441 | } | 441 | } |
| 442 | if (ctx.uses_y_direction) { | ||
| 443 | header += "PARAM y_direction[1]={state.material.front.ambient};"; | ||
| 444 | } | ||
| 442 | ctx.code.insert(0, header); | 445 | ctx.code.insert(0, header); |
| 443 | ctx.code += "END"; | 446 | ctx.code += "END"; |
| 444 | return ctx.code; | 447 | return ctx.code; |
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h index c24c7a71d..7b0f75405 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h +++ b/src/shader_recompiler/backend/glasm/emit_glasm_instructions.h | |||
| @@ -71,7 +71,7 @@ void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst); | |||
| 71 | void EmitInvocationId(EmitContext& ctx, IR::Inst& inst); | 71 | void EmitInvocationId(EmitContext& ctx, IR::Inst& inst); |
| 72 | void EmitSampleId(EmitContext& ctx, IR::Inst& inst); | 72 | void EmitSampleId(EmitContext& ctx, IR::Inst& inst); |
| 73 | void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst); | 73 | void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst); |
| 74 | void EmitYDirection(EmitContext& ctx); | 74 | void EmitYDirection(EmitContext& ctx, IR::Inst& inst); |
| 75 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, ScalarU32 word_offset); | 75 | void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, ScalarU32 word_offset); |
| 76 | void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value); | 76 | void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value); |
| 77 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst); | 77 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst); |
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 022b6584c..2a92d9df5 100644 --- a/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp +++ b/src/shader_recompiler/backend/glasm/emit_glasm_not_implemented.cpp | |||
| @@ -207,8 +207,9 @@ void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst) { | |||
| 207 | ctx.Add("MOV.S {}.x,fragment.helperthread.x;", inst); | 207 | ctx.Add("MOV.S {}.x,fragment.helperthread.x;", inst); |
| 208 | } | 208 | } |
| 209 | 209 | ||
| 210 | void EmitYDirection(EmitContext& ctx) { | 210 | void EmitYDirection(EmitContext& ctx, IR::Inst& inst) { |
| 211 | NotImplemented(); | 211 | ctx.uses_y_direction = true; |
| 212 | ctx.Add("MOV.F {}.x,y_direction[0].w;", inst); | ||
| 212 | } | 213 | } |
| 213 | 214 | ||
| 214 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) { | 215 | void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) { |