SPIRV-Cross/reference
Chip Davis aa5a8c482e MSL: Prevent stores to storage resources in discarded fragments.
Some Metal devices have a bug where storage resources can still be
written to even if the fragment is discarded. This is obviously a bug in
Metal, but bothering Apple to fix it will only fix it for newer
versions; therefore, a workaround is needed for older versions. I have
made this an option so that, in case the bug is ever fixed, the
workaround can be disabled.

This workaround is simple: if a fragment shader may discard its fragment
and writes to a storage resource, a variable representing the
`HelperInvocation` built-in is created and passed to all functions. The
flag is checked on all resource writes; writes do not occur when
`HelperInvocation` is `true`. This relies on the earlier workaround to
update `HelperInvocation` when the fragment is discarded.

Fixes at least 3 failures in the CTS.
2022-11-20 01:29:41 -08:00
..
opt MSL: Prevent stores to storage resources in discarded fragments. 2022-11-20 01:29:41 -08:00
shaders Update mesh/task test references. 2022-09-12 12:46:14 +02:00
shaders-hlsl HLSL: Do not support ClipCull size > 4 in mesh shaders. 2022-11-02 13:34:11 +01:00
shaders-hlsl-no-opt HLSL: Fix test for non-block per-primitive IO. 2022-11-02 13:41:32 +01:00
shaders-msl MSL: Prevent stores to storage resources in discarded fragments. 2022-11-20 01:29:41 -08:00
shaders-msl-no-opt MSL: Manually update BuiltInHelperInvocation when a fragment is discarded. 2022-11-19 23:48:26 -08:00
shaders-no-opt GLSL: Add test for mesh with non-block builtin IO. 2022-11-02 13:08:56 +01:00
shaders-reflection remove newline at eof 2022-04-26 19:15:51 +02:00
shaders-ue4/asm MSL: only fix up gl_FragCoord if really necessary. 2022-09-13 18:50:57 +08:00
shaders-ue4-no-opt/asm Update dependencies. 2022-09-02 14:58:04 +02:00