GL_OES_packed_depth_stencil#

Supported Hardware#

Series5, Series5XT, Series6, Series6XE, Series6XT (ES2/3 Only)

Valid APIs#

OpenGL ES 1.x, 2.0

Description#

Typical use of a depth buffer can generally be satisfied with a 24-bit buffer, but this is generally unaligned with respect to power-of-two boundaries. Having 8-bits of stencil data is typically more than enough for most applications, so it is a natural fit to interleave the two buffer types. By doing so, the overall buffer can be aligned to power-of-two boundaries for speed, without wasting any memory.

Note#

This functionality is core to OpenGL ES 3.0.

Example#

// Create a packed depth and stencil texture format, normally you would not upload data here
// for this
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_STENCIL_OES, 1024, 1024, 0, GL_DEPTH_STENCIL_OES,
GL_UNSIGNED_INT_24_8_OES, NULL);