aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/glasm_emit_context.cpp
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-30 05:02:43 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-11-01 11:29:29 -0500
commit310dd596d0f6d48de3517cfb1bdc90a366817405 (patch)
tree751386685eefaa7b86037893e80f76077b87883b /src/shader_recompiler/backend/glasm/glasm_emit_context.cpp
parenteb02d1dd53a03d0bb6ce541694243579a4c10c6f (diff)
shader_recompiler: translate Switch 2 task and mesh programs
Mario Kart World draws some of its geometry with NVN task and mesh programs (the task program culls and writes the mesh workgroup count and a payload to its stage buffer; each mesh workgroup reads it back and writes vertices and primitives). Add Task and Mesh stages and translate them for VK_EXT_mesh_shader: - the ISBE pseudo instruction from the lowering becomes reads and writes of an emulated stage buffer: the task's output region is the task payload, the mesh output regions live in workgroup memory - every EXIT of these stages jumps to one final return, so all invocations reach the epilogue: a barrier, then OpEmitMeshTasksEXT, or OpSetMeshOutputsEXT and a copy of the 32-element vertex and primitive groups (lines named by the mesh header's and the pass-through geometry header's output maps) to arrayed and per-primitive outputs - Sirit lacks the two mesh instructions: they are emitted as OpStore markers and replaced after assembly - fragment inputs a mesh program writes per primitive get PerPrimitiveEXT The captured task and mesh programs of the title translate to SPIR-V that spirv-val accepts.
Diffstat (limited to 'src/shader_recompiler/backend/glasm/glasm_emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/glasm_emit_context.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/glasm_emit_context.cpp b/src/shader_recompiler/backend/glasm/glasm_emit_context.cpp
index 333a91cc58..02b6992b52 100644
--- a/src/shader_recompiler/backend/glasm/glasm_emit_context.cpp
+++ b/src/shader_recompiler/backend/glasm/glasm_emit_context.cpp
@@ -80,6 +80,9 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
case Stage::Compute:
stage_name = "invocation";
break;
+ case Stage::Task:
+ case Stage::Mesh:
+ throw NotImplementedException("GLASM task and mesh programs");
}
const std::string_view attr_stage{stage == Stage::Fragment ? "fragment" : "vertex"};
const VaryingState loads{info.loads.mask | info.passthrough.mask};