SPIRV-Cross/shaders-msl/vert
Chip Davis 688c5fcbda MSL: Add support for processing more than one patch per workgroup.
This should hopefully reduce underutilization of the GPU, especially on
GPUs where the thread execution width is greater than the number of
control points.

This also simplifies initialization by reading the buffer directly
instead of using Metal's vertex-attribute-in-compute support. It turns
out the only way in which shader stages are allowed to differ in their
interfaces is in the number of components per vector; the base type must
be the same. Since we are using the raw buffer instead of attributes, we
can now also emit arrays and matrices directly into the buffer, instead
of flattening them and then unpacking them. Structs are still flattened,
however; this is due to the need to handle vectors with fewer components
than were output, and I think handling this while also directly emitting
structs could get ugly.

Another advantage of this scheme is that the extra invocations needed to
read the attributes when there were more input than output points are
now no more. The number of threads per workgroup is now lcm(SIMD-size,
output control points). This should ensure we always process a whole
number of patches per workgroup.

To avoid complexity handling indices in the tessellation control shader,
I've also changed the way vertex shaders for tessellation are handled.
They are now compute kernels using Metal's support for vertex-style
stage input. This lets us always emit vertices into the buffer in order
of vertex shader execution. Now we no longer have to deal with indexing
in the tessellation control shader. This also fixes a long-standing
issue where if an index were greater than the number of vertices to
draw, the vertex shader would wind up writing outside the buffer, and
the vertex would be lost.

This is a breaking change, and I know SPIRV-Cross has other clients, so
I've hidden this behind an option for now. In the future, I want to
remove this option and make it the default.
2020-07-23 17:59:54 -05:00
..
basic.capture.vert MSL: Add a setting to capture vertex shader output to a buffer. 2019-02-05 20:00:10 -06:00
basic.for-tess.vert MSL: Add support for processing more than one patch per workgroup. 2020-07-23 17:59:54 -05:00
basic.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
clip-distance-block.no-user-varying.vert MSL: Allow removing clip distance user varyings. 2020-04-20 09:58:40 +02:00
clip-distance-block.vert MSL: Support ClipDistance as an input stage variable. 2019-12-02 13:19:42 +01:00
copy.flatten.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
dynamic.flatten.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
float-math.invariant-float-math.vert Added '--msl-invariant-float-math' option and new test case for it. 2019-10-09 14:03:06 -04:00
float-math.vert Added '--msl-invariant-float-math' option and new test case for it. 2019-10-09 14:03:06 -04:00
functions.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
in_out_array_mat.vert CompilerMSL support matrices & arrays in stage-in & stage-out. 2018-06-12 11:41:35 -04:00
interface-block-block-composites.frag MSL: Support composites inside I/O blocks 2019-01-09 09:33:10 +01:00
interface-block-block-composites.vert MSL: Support composites inside I/O blocks 2019-01-09 09:33:10 +01:00
interpolation-qualifiers-block.vert Handle interpolation qualifiers on the entire struct, too. 2018-09-06 12:29:42 -05:00
interpolation-qualifiers.vert Add tests showing we don't emit interpolation qualifiers in vertex shaders. 2018-09-06 12:28:22 -05:00
invariant.msl21.vert MSL: Support Invariant qualifier on position. 2019-06-12 09:39:12 +02:00
leaf-function.capture.vert Test that out variables still work in leaf functions with capture on. 2019-02-06 10:49:25 -06:00
leaf-function.for-tess.vert MSL: Add support for processing more than one patch per workgroup. 2020-07-23 17:59:54 -05:00
no_stage_out.for-tess.vert MSL: Add support for processing more than one patch per workgroup. 2020-07-23 17:59:54 -05:00
no_stage_out.vert CompilerMSL vertex entry point return void when rasterization disabled. 2018-07-26 00:50:33 -04:00
no_stage_out.write_buff_atomic.vert CompilerMSL disable rasterization on buffer writes in vertex shader. 2018-07-27 16:53:36 -04:00
no_stage_out.write_buff.vert CompilerMSL disable rasterization on buffer writes in vertex shader. 2018-07-27 16:53:36 -04:00
no_stage_out.write_tex.vert CompilerMSL vertex entry point return void when rasterization disabled. 2018-07-26 00:50:33 -04:00
no-disable-vertex-out.frag-output.vert MSL: Only disable output variables in fragment shaders. 2020-04-15 12:14:57 -05:00
out_block.vert Assign block locations to members in MSL. 2017-06-21 09:55:46 +02:00
packed_matrix.vert CompilerMSL support smaller offsets for 3-row row-major matrices. 2018-02-11 16:52:57 -05:00
packed-bool2-to-packed_uint2.vert Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix. 2020-05-06 00:43:34 +08:00
packed-bool-to-uint.vert Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix. 2020-05-06 00:43:34 +08:00
pointsize.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
read-from-row-major-array.vert Force recompile if we add row-major transpose functions in MSL. 2018-05-04 09:43:34 +02:00
resource-arrays-leaf.ios.vert Update to latest glslang/SPIRV-Tools. 2019-01-30 13:41:57 +01:00
resource-arrays.ios.vert Fixup MSL iOS test. 2019-01-30 16:26:41 +01:00
return-array.force-native-array.vert MSL: Reinstate workaround for returning arrays. 2020-02-24 13:04:10 +01:00
return-array.vert Return arrays in HLSL/MSL by writing to an output variable instead. 2018-02-08 12:22:08 +01:00
set_builtin_in_func.vert Fixes from PR 621 code review. 2018-06-25 11:40:20 -04:00
sign-int-types.vert MSL: Emit wrapper for SSign (sign() for int types) 2018-11-08 13:08:34 +10:00
signedness-mismatch.shader-inputs.vert MSL: Fix up input variables' vector lengths in all stages. 2020-06-16 14:50:30 -05:00
texture_buffer.texture-buffer-native.msl21.vert MSL: Support native texture_buffer type, throw error on atomics. 2019-04-23 12:21:43 +02:00
texture_buffer.vert CompilerMSL map many GLSL functions to MSL functions. 2017-05-19 18:14:08 -04:00
ubo.alignment.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00
ubo.vert Add explicit in/out locations everywhere. 2017-06-21 09:39:08 +02:00