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

Optimize out some stencil emulation, try to avoid depth write #11620

Merged
merged 4 commits into from
Dec 2, 2018

Conversation

unknownbrackets
Copy link
Collaborator

See #11535 (comment) - depth is basically broken no matter what you do. If stencil is not involved, then early depth tests are mostly the better broken.

Probably fixes #11583, at least there's no visible issue in that scene with the broken depth testing now (though there might be weird artifacts around it, not sure.) Doesn't help #11535.

Also, the optimization mostly prevents vec4(v, 0.0) in many cases when it's unnecessary, and cuts down on blending.

-[Unknown]

Otherwise it doesn't always apply.
This reduces use of replaceAlpha, and reduces use of more complicated
blend states.  This simplifies fragment shaders a little.
It seems like depth gets messed up either way on discard, but behaves
sorta better without the write to depth.
@unknownbrackets unknownbrackets added this to the v1.8.0 milestone Dec 1, 2018
@Leopard20
Copy link
Contributor

Thank you.
Any chance it might help #11227 ?

@hrydgard hrydgard merged commit 9a7ee41 into hrydgard:master Dec 2, 2018
@unknownbrackets unknownbrackets deleted the stencil-skip branch December 2, 2018 22:15
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.

[Vulkan] Weird shader bug (Z-fighting?)
3 participants