Add MSL argument buffer support
A Metal render pipeline state that declares
supportIndirectCommandBuffers cannot have a texture bound directly to
its vertex or fragment function, which makes indirect draw calls
sourcing the draw count from a buffer unavailable for any shader that
samples a texture.
Add --msl-argument-buffers (MSLARGUMENTBUFFERS for qt_add_shaders),
which generates a second set of Metal shaders, under the new
QShader::ArgumentBufferShader variant, where the images and samplers are
accessed through an argument buffer.
Only the images and samplers move: they are given a descriptor set of
their own, that set becomes the argument buffer, and every other set is
marked discrete, so uniform and storage buffers stay bound individually
and dynamic offsets keep working. The argument buffer is pinned to
buffer index 0 because SPIRV-Cross starts the automatic buffer bindings
right after it, and the index is reported via nativeShaderInfo so the
backend can find it. The texture and sampler entries of the native
resource binding map then name ids within the argument buffer rather
than indices in the argument tables; the map itself is unchanged in
shape, because only the descriptor set decoration is rewritten, never
the binding.
Argument buffers need MSL 2.0, and are a no-op for a shader with no
images or samplers, so the variant is skipped in both cases: such a
shader can be used with indirect command buffers as-is.
Change-Id: I07cd184de0082719fb9c802a87d51a956a356fc7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>