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

Land PR 2324 #2327

Merged
merged 2 commits into from
May 21, 2024
Merged

Land PR 2324 #2327

merged 2 commits into from
May 21, 2024

Conversation

HansKristian-Work
Copy link
Contributor

@HansKristian-Work HansKristian-Work commented May 21, 2024

Supersedes #2324.

aitor-lunarg and others added 2 commits May 21, 2024 11:24
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.
@HansKristian-Work HansKristian-Work merged commit 1f68d0f into main May 21, 2024
6 checks passed
@HansKristian-Work HansKristian-Work deleted the pr-2324 branch May 21, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants