Forums - depth texture with GL_DEPTH24_STENCIL8

1 post / 0 new
depth texture with GL_DEPTH24_STENCIL8
milesmj
Join Date: 14 Nov 13
Posts: 2
Posted: Tue, 2017-08-29 12:21

Hi everyone,

I am using a depth texture that works correctly on other devices (ios, tegra), but not on adreno. I am using opengl es 3.0, so the set up calls follow those specs. Here's the relevant call:

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH24_STENCIL8, w, h, 0, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, 0);

Note that when I use the older, opengl es 2.0 version of the call, it works:

glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, w, h, 0, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, 0);

When the opengl es 3 way is sampled from a shader, it seems to return 0.0 no matter what. The opengl es 2.0 version returns the expected value when sampled in a the shader.

The problem is that I can't use the older version (GL_DEPTH_STENCIL_OES instead of GL_DEPTH24_STENCIL8), because that causes problems when blitting to the default framebuffer on some devices (because the default framebuffer depth attachment seems to have internal format of GL_DEPTH24_STENCIL8 and not GL_DEPTH_STENCIL_OES).

Any ideas why GL_DEPTH_STENCIL_OES works, but GL_DEPTH24_STENCIL8 doesn't? Thanks!

  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.