Skip to content

Commit

Permalink
MSL: Fix crash when per-primitive variables are not used.
Browse files Browse the repository at this point in the history
  • Loading branch information
HansKristian-Work committed Oct 30, 2024
1 parent bf41c8a commit 99e6f3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion spirv_msl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19232,7 +19232,6 @@ void CompilerMSL::emit_mesh_outputs()

if (mesh_out_per_primitive != 0 || builtin_mesh_primitive_indices_id != 0)
{
auto &type_prim = get<SPIRType>(mesh_out_per_primitive);
if (num_invocations < mode.output_primitives)
{
statement("for (uint spvPI = gl_LocalInvocationIndex; spvPI < spvMeshSizes.y; spvPI += spvThreadCount)");
Expand Down Expand Up @@ -19268,6 +19267,7 @@ void CompilerMSL::emit_mesh_outputs()

if (mesh_out_per_primitive != 0)
{
auto &type_prim = get<SPIRType>(mesh_out_per_primitive);
statement("spvPerPrimitive spvP = {};");
for (uint32_t index = 0; index < uint32_t(type_prim.member_types.size()); ++index)
{
Expand Down

0 comments on commit 99e6f3a

Please sign in to comment.