MSL: Minor fix to resource type of spvBufferSizeConstants array indexes.

- spvBufferSizeConstants tracks MSL indexes of buffers, not images.
- Previous code did not allow array index beyond zero.
This commit is contained in:
Bill Hollings 2024-07-13 11:02:21 -04:00 committed by Hans-Kristian Arntzen
parent c1bf9099b9
commit 1297499703

View File

@ -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
{