Imagination PowerVR SDK Blog

depth buffer on nexus s seems to get cleared automatically for each frame


Seems that with the driver for Nexus S the depth buffer is cleared automatically (i.e. does not require glClear(GL_DEPTH_BUFFER_BIT)). As a simple test I took the BasicGLSurfaceView sample from the android sdk, removed the depth bit from the call to glClear and enabled depth test.

public void onDrawFrame(GL10 glUnused) {

// Ignore the passed-in GL10 interface, and use the GLES20

// class’s static methods instead.

GLES20.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);





On other android devices I get the expected behavior (the triangle eventually disappear as it rotates in place). With the Nexus S the triangle is happily visible the whole time. Seems like the depth buffer is cleared (or the depth values are not copied) from one frame to the next. Is this a driver bug?

We need the depth buffer information to be maintained across multiple frames but that doesn’t seem possible with Nexus S.

thanks for any help,



Hi yotto,

Some driver configurations disable depth buffer preservation between frames. This prevents excess bandwidth being used by applications that don’t need to preserve the data.

You should be able to workaround the issue by using a depth texture instead of a depth buffer, as this will force the GPU to preserve the data.




Thanks for the tip Joe! Seems to work.


No problem :slight_smile: