Open billhollings opened 3 years ago
I suppose it's possible to implement OpCompositeInsert as a Construct, where one of the elements are replaced. It gets very hairy with things like spec constant arrays though, since we don't necessarily know the array size in SPIRV-Cross compile time, but MSL doesn't support array spec constants to begin with ...
but MSL doesn't support array spec constants to begin with
Yes. WRT array lengths, that specific issue is probably something we can leave for a later revision or enhancement, but for now we need to live with that general restriction about spec constants under MSL.
Several Vulkan CTS tests use op
OpCompositeInsert
inOpSpecConstantOp
, which is not currently supported in SPIRV-Cross. Consequently, these tests fail in MoltenVK.I've had a look, but it is not at all clear to me how a modified constant composite can be created in MSL via SPIRV-Cross. The corresponding instruction for the non-constant
OpCompositeInsert
op relies on emitting statements to crate a temp var copy of the composite, and then modifying part of it, which won't be possible with a constant value.For a constant expression, it would seem we will have to construct the new composite on the fly, with the appropriate element modified as the composite is being created, but unfortunately, the internal plumbing for that is beyond my understanding of SPIRV-Cross innards.
[edit]: Adding CTS tests affected: