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

EarlyFragmentTests #159

Closed
twanks123 opened this issue May 26, 2016 · 2 comments
Closed

EarlyFragmentTests #159

twanks123 opened this issue May 26, 2016 · 2 comments
Labels

Comments

@twanks123
Copy link

twanks123 commented May 26, 2016

Hello Sascha,
i am working on a rendering engine with vulkan and i have a really silly question :D
So far so good i can render unlimited objects with textures and lighting also works (forward rendering with blending pipelines).
But i need the Depth-Test to be calculated before the fragment shader executes and i dont know how i can specify this in the shader. I dont understand what the Vulkan Documentation means:

An explicit control is provided to allow fragment shaders to enable early fragment tests. If the fragment shader specifies the EarlyFragmentTests OpExecutionMode, the per-fragment tests described in Early Fragment Test Mode are performed prior to fragment shader execution. Otherwise, they are performed after fragment shader execution.

So how i specify "EarlyFragmentTests OpExecutionMode"? Thanks in advance :) (and thanks for your awesome code samples!)

@SaschaWillems
Copy link
Owner

SaschaWillems commented May 27, 2016

I haven't yet used early fragment tests in Vulkan, but they should be enabled the same way as with OpenGL (see here).

The "OpExecutionMode" refers to SPIR-V. To enable this, put this in your GLSL shader:

layout(early_fragment_tests) in;

This will enable the SPIR-V exection mode:

image

P.S. : Can you please use the official Khronos forums for Vulkan or stakoverflow for asking Vulkan related questions instead of the issue tracker? I'm active on both 😉

@twanks123
Copy link
Author

okay thanks i didnt know where to ask such questions. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants