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

This topic contains 3 replies, has 2 voices, and was last updated by  Joe Davis 4 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #31114


    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,



    Joe Davis

    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.


    Joe Davis

    No problem 🙂

Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic.