aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-21 02:12:32 -0300
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:33 -0400
commit9e7b6622c25aa858b96bf0f1c7f94223a2f449a2 (patch)
tree48c62889aeb79d6f0f01a467ba0d1ac01dec512b /src/shader_recompiler/backend/glasm/emit_glasm.cpp
parenteb156679057340524c3e1e00d4910c88a2f3c6c2 (diff)
shader: Split profile and runtime information in separate structs
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
index f110fd7f88..edff04a44e 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
@@ -374,8 +374,9 @@ std::string_view GetTessSpacing(TessSpacing spacing) {
}
} // Anonymous namespace
-std::string EmitGLASM(const Profile& profile, IR::Program& program, Bindings& bindings) {
- EmitContext ctx{program, bindings, profile};
+std::string EmitGLASM(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program,
+ Bindings& bindings) {
+ EmitContext ctx{program, bindings, profile, runtime_info};
Precolor(ctx, program);
EmitCode(ctx, program);
std::string header{StageHeader(program.stage)};
@@ -385,18 +386,18 @@ std::string EmitGLASM(const Profile& profile, IR::Program& program, Bindings& bi
header += fmt::format("VERTICES_OUT {};", program.invocations);
break;
case Stage::TessellationEval:
- header +=
- fmt::format("TESS_MODE {};"
- "TESS_SPACING {};"
- "TESS_VERTEX_ORDER {};",
- GetTessMode(profile.tess_primitive), GetTessSpacing(profile.tess_spacing),
- profile.tess_clockwise ? "CW" : "CCW");
+ header += fmt::format("TESS_MODE {};"
+ "TESS_SPACING {};"
+ "TESS_VERTEX_ORDER {};",
+ GetTessMode(runtime_info.tess_primitive),
+ GetTessSpacing(runtime_info.tess_spacing),
+ runtime_info.tess_clockwise ? "CW" : "CCW");
break;
case Stage::Geometry:
header += fmt::format("PRIMITIVE_IN {};"
"PRIMITIVE_OUT {};"
"VERTICES_OUT {};",
- InputPrimitive(profile.input_topology),
+ InputPrimitive(runtime_info.input_topology),
OutputPrimitive(program.output_topology), program.output_vertices);
break;
case Stage::Compute: