Skip to content

Commit

Permalink
MSL: Minor fix to resource type of spvBufferSizeConstants array indexes.
Browse files Browse the repository at this point in the history
- spvBufferSizeConstants tracks MSL indexes of buffers, not images.
- Previous code did not allow array index beyond zero.
  • Loading branch information
billhollings authored and HansKristian-Work committed Jul 15, 2024
1 parent c1bf909 commit 1297499
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 @@ -14085,7 +14085,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
statement("constant uint", is_array_type ? "* " : "& ", to_buffer_size_expression(var_id),
is_array_type ? " = &" : " = ", to_name(argument_buffer_ids[desc_set]),
".spvBufferSizeConstants", "[",
convert_to_string(get_metal_resource_index(var, SPIRType::Image)), "];");
convert_to_string(get_metal_resource_index(var, SPIRType::UInt)), "];");
}
else
{
Expand Down

0 comments on commit 1297499

Please sign in to comment.