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

MSL: Add option to force depth write in fragment shaders #2331

Merged

Conversation

aitor-lunarg
Copy link
Contributor

Metal writes to the depth/stencil attachment before fragment shader execution if the execution does not modify the depth value. However, Vulkan expects the write to happen after fragment shader execution. To circumvent the issue we add a simple depth passthrough if the user opts in. Only required when the depth/stencil attachment is used as input attachment at the same time. It seems Metal does not correctly detect the dependency.

Required for KhronosGroup/MoltenVK#2232

spirv_msl.hpp Show resolved Hide resolved
Metal writes to the depth/stencil attachment before fragment
shader execution if the execution does not modify the depth
value. However, Vulkan expects the write to happen after
fragment shader execution. To circumvent the issue we add
a simple depth passthrough if the user opts in. Only
required when the depth/stencil attachment is used as
input attachment at the same time. It seems Metal does not
correctly detect the dependency.
@HansKristian-Work HansKristian-Work merged commit d47a140 into KhronosGroup:main May 24, 2024
6 checks passed
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