summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm.cpp
diff options
context:
space:
mode:
authorGravatar ReinUsesLisp2021-05-21 02:12:32 -0300
committerGravatar ameerj2021-07-22 21:51:33 -0400
commit9e7b6622c25aa858b96bf0f1c7f94223a2f449a2 (patch)
tree48c62889aeb79d6f0f01a467ba0d1ac01dec512b /src/shader_recompiler/backend/glasm/emit_glasm.cpp
parentemit_glasm_context_get_and_set.cpp: Add missing semicolons (diff)
downloadyuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.gz
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.tar.xz
yuzu-9e7b6622c25aa858b96bf0f1c7f94223a2f449a2.zip
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 f110fd7f8..edff04a44 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) {
374} 374}
375} // Anonymous namespace 375} // Anonymous namespace
376 376
377std::string EmitGLASM(const Profile& profile, IR::Program& program, Bindings& bindings) { 377std::string EmitGLASM(const Profile& profile, const RuntimeInfo& runtime_info, IR::Program& program,
378 EmitContext ctx{program, bindings, profile}; 378 Bindings& bindings) {
379 EmitContext ctx{program, bindings, profile, runtime_info};
379 Precolor(ctx, program); 380 Precolor(ctx, program);
380 EmitCode(ctx, program); 381 EmitCode(ctx, program);
381 std::string header{StageHeader(program.stage)}; 382 std::string header{StageHeader(program.stage)};
@@ -385,18 +386,18 @@ std::string EmitGLASM(const Profile& profile, IR::Program& program, Bindings& bi
385 header += fmt::format("VERTICES_OUT {};", program.invocations); 386 header += fmt::format("VERTICES_OUT {};", program.invocations);
386 break; 387 break;
387 case Stage::TessellationEval: 388 case Stage::TessellationEval:
388 header += 389 header += fmt::format("TESS_MODE {};"
389 fmt::format("TESS_MODE {};" 390 "TESS_SPACING {};"
390 "TESS_SPACING {};" 391 "TESS_VERTEX_ORDER {};",
391 "TESS_VERTEX_ORDER {};", 392 GetTessMode(runtime_info.tess_primitive),
392 GetTessMode(profile.tess_primitive), GetTessSpacing(profile.tess_spacing), 393 GetTessSpacing(runtime_info.tess_spacing),
393 profile.tess_clockwise ? "CW" : "CCW"); 394 runtime_info.tess_clockwise ? "CW" : "CCW");
394 break; 395 break;
395 case Stage::Geometry: 396 case Stage::Geometry:
396 header += fmt::format("PRIMITIVE_IN {};" 397 header += fmt::format("PRIMITIVE_IN {};"
397 "PRIMITIVE_OUT {};" 398 "PRIMITIVE_OUT {};"
398 "VERTICES_OUT {};", 399 "VERTICES_OUT {};",
399 InputPrimitive(profile.input_topology), 400 InputPrimitive(runtime_info.input_topology),
400 OutputPrimitive(program.output_topology), program.output_vertices); 401 OutputPrimitive(program.output_topology), program.output_vertices);
401 break; 402 break;
402 case Stage::Compute: 403 case Stage::Compute: