SPIRV-Cross-Vulnerable/shaders-msl
Chip Davis fd738e3387 MSL: Adjust FragCoord for sample-rate shading.
In Metal, the `[[position]]` input to a fragment shader remains at
fragment center, even at sample rate, like OpenGL and Direct3D. In
Vulkan, however, when the fragment shader runs at sample rate, the
`FragCoord` builtin moves to the sample position in the framebuffer,
instead of the fragment center. To account for this difference, adjust
the `FragCoord`, if present, by the sample position. The -0.5 offset is
because the fragment center is at (0.5, 0.5).

Also, add an option to force sample-rate shading in a fragment shader.
Since Metal has no explicit control for this, this is done by adding a
dummy `[[sample_id]]` which is otherwise unused, if none is already
present. This is intended to be used from e.g. MoltenVK when a
pipeline's `minSampleShading` value is nonzero.

Instead of checking if any `Input` variables have `Sample`
interpolation, I've elected to check that the `SampleRateShading`
capability is present. Since `SampleId`, `SamplePosition`, and the
`Sample` interpolation decoration require this cap, this should be
equivalent for any valid SPIR-V module. If this isn't acceptable, let me
know.
2020-11-23 10:30:24 -06:00
..
amd MSL: Support the SPV_AMD_shader_trinary_minmax extension. 2019-07-13 16:43:57 -05:00
asm MSL: Support pull-model interpolation on MSL 2.3+. 2020-11-05 11:57:45 -06:00
comp MSL: Support atomic access to images from argument buffers. 2020-10-13 02:37:18 -05:00
desktop-only MSL: Add support for processing more than one patch per workgroup. 2020-07-23 17:59:54 -05:00
flatten Use declared binding in SPIR-V as a fallback for explicit MSL binds. 2018-04-04 12:25:11 +02:00
frag MSL: Adjust FragCoord for sample-rate shading. 2020-11-23 10:30:24 -06:00
intel MSL: Support the SPV_INTEL_shader_integer_functions2 extension. 2019-07-15 09:42:36 -05:00
legacy/vert Enhance MSL testing and add numerous MSL test cases. 2017-01-30 22:55:21 -05:00
tesc MSL: Don't use a bitcast for tessellation levels in tesc shaders. 2020-10-14 18:35:59 -05:00
tese MSL: Rewrite tessellation_access_chain. 2019-10-26 16:10:12 +02:00
vert MSL: Add support for processing more than one patch per workgroup. 2020-07-23 17:59:54 -05:00
vulkan MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3. 2020-10-13 00:25:32 -05:00