Jump to content
  • Advertisement
Sign in to follow this  
Alundra

OpenGL glColorMask all parameters false, guarantee to not use fragment?

Recommended Posts

Hi everybody,
Is it guarantee that using glColorMask with all the parameters to false will block the fragment shader to be executed?
Thank you

Share this post


Link to post
Share on other sites
Advertisement

If what you want is to do nothing in the fragment shader then simply create a shader program with no fragment shaders.

Apart from this, and except if I missed something about OpenGL, color masking is not related with the fragment shader. It is related with the framebuffer. So the fragment shader will be executed, except that its output(s) will not be written in the framebuffer attached and selected draw buffer(s).

Share this post


Link to post
Share on other sites
15 hours ago, Alundra said:

Is it guarantee

No. A smart driver may be able to detect that the colour output of the fragment shader is useless, and skip running fragment shading (as long as the shader doesn't also output other information - custom depth values, discard statements, etc).. but this is not guaranteed behaviour by the GL spec.

Share this post


Link to post
Share on other sites
7 hours ago, Hodgman said:

No. A smart driver may be able to detect that the colour output of the fragment shader is useless, and skip running fragment shading (as long as the shader doesn't also output other information - custom depth values, discard statements, etc).. but this is not guaranteed behaviour by the GL spec.

Thanks for this information.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!