SPIRV-Cross/shaders-msl
Aitor Camacho cd8865deab Add option to enforce fragment execution with side effects in MSL
Metal will incorrectly discard fragments with side effects under
certain circumstances prematurely. The conditions are the following:
 - Fragment will always be discarded after side effect operation
 - Pre fragment depth fails
 - Modifies depth value for a constant value in the fragment shader.
   This constant value will also fail the depth test.

However, Metal will also discard the fragment even if it has
operations with side effects inside the fragment shader before the
discard operation.

Vulkan states the graphics pipeline to execute in the following
order:
 - Pre fragment depth test (cannot discard here due to modifying
   depth value in fragment shader)
 - Fragment shader (where the depth is modified and fragment
   discarded)
 - Post fragment depth test

Therefore, we need to enforce fragment shader execution and not
let Metal discard the fragment before that for such cases. This
change adds an option to provide such utility.
2024-05-21 11:24:56 +02:00
..
amd MSL: Support the SPV_AMD_shader_trinary_minmax extension. 2019-07-13 16:43:57 -05:00
asm MSL: Fix SUMulExtended for 64-bit inputs. 2024-04-15 13:37:00 +02:00
comp Fix tabbing nits. 2024-04-03 13:49:41 +02: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 Add option to enforce fragment execution with side effects in MSL 2024-05-21 11:24:56 +02: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
masking MSL: Fix copy of arrays to/from stage IO variables. 2021-04-19 12:10:49 +02:00
tesc MSL: Don't flatten arrayed per-patch output blocks in tessellation shaders. 2022-10-18 15:04:42 -07:00
tese MSL: Fix patch vertex count with raw buffer tese input. 2023-12-04 14:24:16 -08:00
vert MSL: Add support for SPV_KHR_physical_storage_buffer extension. 2022-06-20 20:21:00 -04:00
vulkan MSL: Manually update BuiltInHelperInvocation when a fragment is discarded. 2022-11-19 23:48:26 -08:00