mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-23 15:22:45 +01:00
glasm: Implement Y direction
This commit is contained in:
parent
586c785366
commit
f58f79c85d
4 changed files with 9 additions and 3 deletions
|
@ -70,6 +70,8 @@ public:
|
||||||
Stage stage{};
|
Stage stage{};
|
||||||
std::string_view stage_name = "invalid";
|
std::string_view stage_name = "invalid";
|
||||||
std::string_view attrib_name = "invalid";
|
std::string_view attrib_name = "invalid";
|
||||||
|
|
||||||
|
bool uses_y_direction{};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Shader::Backend::GLASM
|
} // namespace Shader::Backend::GLASM
|
||||||
|
|
|
@ -439,6 +439,9 @@ std::string EmitGLASM(const Profile& profile, const RuntimeInfo& runtime_info, I
|
||||||
"MOV.F FSWZB[2],1;"
|
"MOV.F FSWZB[2],1;"
|
||||||
"MOV.F FSWZB[3],-1;";
|
"MOV.F FSWZB[3],-1;";
|
||||||
}
|
}
|
||||||
|
if (ctx.uses_y_direction) {
|
||||||
|
header += "PARAM y_direction[1]={state.material.front.ambient};";
|
||||||
|
}
|
||||||
ctx.code.insert(0, header);
|
ctx.code.insert(0, header);
|
||||||
ctx.code += "END";
|
ctx.code += "END";
|
||||||
return ctx.code;
|
return ctx.code;
|
||||||
|
|
|
@ -71,7 +71,7 @@ void EmitLocalInvocationId(EmitContext& ctx, IR::Inst& inst);
|
||||||
void EmitInvocationId(EmitContext& ctx, IR::Inst& inst);
|
void EmitInvocationId(EmitContext& ctx, IR::Inst& inst);
|
||||||
void EmitSampleId(EmitContext& ctx, IR::Inst& inst);
|
void EmitSampleId(EmitContext& ctx, IR::Inst& inst);
|
||||||
void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst);
|
void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst);
|
||||||
void EmitYDirection(EmitContext& ctx);
|
void EmitYDirection(EmitContext& ctx, IR::Inst& inst);
|
||||||
void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, ScalarU32 word_offset);
|
void EmitLoadLocal(EmitContext& ctx, IR::Inst& inst, ScalarU32 word_offset);
|
||||||
void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value);
|
void EmitWriteLocal(EmitContext& ctx, ScalarU32 word_offset, ScalarU32 value);
|
||||||
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst);
|
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst);
|
||||||
|
|
|
@ -207,8 +207,9 @@ void EmitIsHelperInvocation(EmitContext& ctx, IR::Inst& inst) {
|
||||||
ctx.Add("MOV.S {}.x,fragment.helperthread.x;", inst);
|
ctx.Add("MOV.S {}.x,fragment.helperthread.x;", inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitYDirection(EmitContext& ctx) {
|
void EmitYDirection(EmitContext& ctx, IR::Inst& inst) {
|
||||||
NotImplemented();
|
ctx.uses_y_direction = true;
|
||||||
|
ctx.Add("MOV.F {}.x,y_direction[0].w;", inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) {
|
void EmitUndefU1(EmitContext& ctx, IR::Inst& inst) {
|
||||||
|
|
Loading…
Reference in a new issue