[Cogl] [PATCH 1/2] Use the GL_DEPTH24_STENCIL8 internal format for packed buffers

Neil Roberts neil at linux.intel.com
Wed Aug 1 09:41:29 PDT 2012


Damien Lespiau <damien.lespiau at gmail.com> writes:

> GL_DEPTH_STENCIL is not a valid internal format according to
> EXT_packed_depth_stencil. Let's use the the GL_DEPTH24_STENCIL8
> internal format defined by the extension (internal format also used by
> the OES code path).

Are you sure about this? As far as I can see from the spec for
GL_EXT_packed_depth_stencil, GL_DEPTH_STENCIL should accepted by both
glTexImage2D and glRenderBufferStorage. See this quote:

“Accepted by the <format> parameter of DrawPixels, ReadPixels,
 TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D,
 TexSubImage3D, and GetTexImage, by the <type> parameter of CopyPixels,
 by the <internalformat> parameter of TexImage1D, TexImage2D,
 TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT,
 and returned in the <data> parameter of GetTexLevelParameter and
 GetRenderbufferParameterivEXT:

        DEPTH_STENCIL_EXT                              0x84F9”

I think it would make sense to continue using GL_DEPTH_STENCIL if we can
because we don't need to specify a minimum precision for the
depth/stencil buffer. That might make it more likely to successfully
allocate a buffer.

I can't explain why it would make the texture proxy fail though. It
might be worth making it fallback to GL_DEPTH24_STENCIL8 if
GL_DEPTH_STENCIL fails. That would just mean making it set
COGL_OFFSCREEN_ALLOCATE_FLAG_DEPTH24_STENCIL8 whenever either
either the corresponding OES or EXT features are available.

Regards,
- Neil


More information about the Cogl mailing list