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

Started by
3 comments, last by _Silence_ 4 years, 11 months ago

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

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).

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.

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.

This topic is closed to new replies.

Advertisement