MoltenVK is a Vulkan Portability implementation. It layers a subset of the high-performance, industry-standard Vulkan graphics and compute API over Apple's Metal graphics framework, enabling Vulkan applications to run on macOS, iOS and tvOS.
Apache License 2.0
4.63k
stars
402
forks
source link
Enforce fragment shader execution when operations with side effects are present before discard #2233
Test has a fragment shader with side effects and a discard operation after. However, fragments get prematurely discarded under certain circumstances as an optimization (when they shouldn't).
We can circumvent this issue by making the discard operation "optional" whenever a side effect operation is present before the discard. Equivalent Metal code for the following GLSL: if (!gl_HelperInvocation) discard;
So, similar to #2232 I believe this is an oversight from Metal's end. MoltenVK should provide a short term solution for this case, and hopefully Metal fixes this issue in the long term.
Failing CTS tests:
Test has a fragment shader with side effects and a discard operation after. However, fragments get prematurely discarded under certain circumstances as an optimization (when they shouldn't).
We can circumvent this issue by making the discard operation "optional" whenever a side effect operation is present before the discard. Equivalent Metal code for the following GLSL:
if (!gl_HelperInvocation) discard;
So, similar to #2232 I believe this is an oversight from Metal's end. MoltenVK should provide a short term solution for this case, and hopefully Metal fixes this issue in the long term.