Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce depth write to post fragment execution when attachment is used as input and output #2232

Closed
aitor-lunarg opened this issue May 8, 2024 · 0 comments · Fixed by #2248
Assignees
Labels
CTS Issue causes a failure of one or more CTS tests

Comments

@aitor-lunarg
Copy link
Collaborator

Failing CTS tests:

dEQP-VK.rasterization.rasterization_order_attachment_access.depth.samples_1.multi_draw_barriers
dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_1.multi_draw_barriers
dEQP-VK.rasterization.rasterization_order_attachment_access.stencil.samples_2.multi_draw_barriers

These tests write to the same attachment in succession and checks that the write happens after fragment execution. However, Metal, for depth attachment under certain conditions (that are met by the test) writes the value before fragment execution which leads to failing the tests.

Solution is to enforce the depth write to post fragment execution. The way I found to accomplish this is by adding a pass through write of the depth value. Equivalent of the following GLSL code in Metal: gl_FragDepth = gl_FragCoord.z;

I couldn't find anything in the Metal specification about graphic pipeline's stage execution order nor synchronization dependencies between them, but I'm inclined to think that the failure of these tests imply there may be an oversight on Metal drivers.

For Vulkan spec text on the issue, please refer to https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/5087

In the short term, I believe implementing the enforced depth write will fix the issue for now, but we may find ourselves in the future having to find a different workaround, or if we are lucky Metal fixes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CTS Issue causes a failure of one or more CTS tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant