SPIRV-Cross/reference/opt/shaders-msl
Bill Hollings ebb5098def MSL: Adjust gl_SampleMaskIn for sample-shading and/or fixed sample mask.
Vulkan specifies that the Sample Mask Test occurs before fragment shading.
This means gl_SampleMaskIn should be influenced by both sample-shading and
VkPipelineMultisampleStateCreateInfo::pSampleMask.

CTS tests dEQP-VK.pipeline.multisample_shader_builtin.* bear this out.

For sample-shading, gl_SampleMaskIn should only have a single bit set,
Since Metal does not filter for this, apply a bitmask based on gl_SampleID.

For a fixed sample mask, since Metal is unaware of
VkPipelineMultisampleStateCreateInfo::pSampleMask, we need to ensure that
we apply it to both gl_SampleMaskIn and gl_SampleMask. This has the side
effect of a redundant application of pSampleMask if the shader already
includes gl_SampleMaskIn when setting gl_SampleMask, but I don't see an
easy way around this.

Also, simplify the logic for including the fixed sample mask in gl_ShaderMask,
and print the fixed sample mask as a hex value for readability of bits.
2021-07-13 21:22:13 -04:00
..
amd Updates for pull request #1162 2019-09-24 14:35:25 -04:00
asm Handle SPIR-V 1.4 selection constructs. 2021-06-28 12:23:44 +02:00
comp MSL: Fix calculation of atomic image buffer address. 2020-10-13 20:51:56 -05:00
desktop-only MSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more threads than control points (#1662) 2021-04-29 20:01:26 +02:00
flatten MSL: Do not generate UnsafeArray<> for any array inside buffer objects. 2019-10-24 12:22:30 +02:00
frag MSL: Adjust gl_SampleMaskIn for sample-shading and/or fixed sample mask. 2021-07-13 21:22:13 -04:00
intel Updates for pull request #1162 2019-09-24 14:35:25 -04:00
legacy/vert Updates for pull request #1162 2019-09-24 14:35:25 -04:00
masking MSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more threads than control points (#1662) 2021-04-29 20:01:26 +02:00
tesc MSL: Fix '--msl-multi-patch-workgroup' out of bounds reads when dispatching more threads than control points (#1662) 2021-04-29 20:01:26 +02:00
tese MSL: Use proper array for quad tess levels. 2021-04-23 14:12:00 +02:00
vert MSL: Handle array with component when we cannot rely on user() attrib. 2021-05-21 13:46:33 +02:00
vulkan MSL: Support SPV_EXT_demote_to_helper_invocation for MSL 2.3. 2020-10-13 00:25:32 -05:00