KhronosGroup / SPIRV-Cross

SPIRV-Cross is a practical tool and library for performing reflection on SPIR-V and disassembling SPIR-V back to high level languages.
Apache License 2.0
1.96k stars 549 forks source link

MSL: Ensure discrete runtime arrays of buffers have known length. #2252

Closed billhollings closed 5 months ago

billhollings commented 5 months ago

An entry-point array of buffers, that is not part of a Metal argument buffer, requires a known length, so it can be emitted as discrete buffers. For runtime arrays of resources, this can be retrieved from the resource binding information added via add_msl_resource_binding().

This has been tested in MoltenVK, but I couldn't think of a way of defining a SPRIV-Cross unit test for this, as it would involve calling add_msl_resource_binding() with some complex input.

Found as a regression during testing for the next Vulkan SDK release.