Imagination PowerVR SDK Blog

glClear problem


It seems I found a bug. glDepthMask(GL_FALSE)  - disables writing to Z-buffer and also disables clearing Z-buffer using glClear function.


From documentation:
"glDepthMask does not affect glClear."

I tell about win32 implementation from v2.3 SDK


The statement on that man page is incorrect, glDepthMask does affect glClear. In general the man pages for ES 1.1 are in a much better state than the ones for ES 1.0:

According to the ES 1.1 full spec:

When Clear is called, the only per-fragment operations that are applied (if

enabled) are the pixel ownership test, the scissor test, and dithering. The masking

operations described in the last section (4.2.2) are also effective.
Xmas2009-03-10 16:08:24


From 1.1 documentation

Alpha function, blend function, logical operation, stenciling, texture mapping, and depth-buffering are ignored by glClear.

This is also incorrect or I misunderstands this statement?


This should probably say that the depth test is ignored. Obviously not depth buffering as a whole, otherwise there would be no way of clearing the depth buffer.