[Mesa-dev] [PATCH 1/2] mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).

Eric Anholt eric at anholt.net
Mon Feb 24 10:23:56 PST 2014


Kenneth Graunke <kenneth at whitecape.org> writes:

> While the GL_ARB_stencil_texturing extension does not allow the creation
> of stencil textures, it does allow shaders to sample stencil values
> stored in packed depth/stencil textures.
>
> Specifically, applications can call glTexParameter* with a pname of
> GL_DEPTH_STENCIL_TEXTURE_MODE and value of either GL_DEPTH_COMPONENT or
> GL_STENCIL_INDEX to select which component they wish to sample.  The
> default value is GL_DEPTH_COMPONENT (for traditional depth sampling).
>
> Shaders should use an unsigned integer sampler (presumably usampler2D)
> to access stencil data.  Otherwise, results are undefined.  Using shadow
> samplers with GL_STENCIL_INDEX selected also is undefined behavior.
>
> This patch creates a new gl_texture_object field, StencilSampling, to
> indicate that stencil should be sampled rather than depth.  (I chose to
> use a boolean since I figured it would be more convenient for drivers.)
> It also introduces the [Get]TexParameter code to get and set the value,
> and of course the extension plumbing.

The only thing I see missing is:

'    Add a new bullet point for the conditions that cause the texture
     to not be complete:

         "* The internal format of the texture is DEPTH_STENCIL, the
         DEPTH_STENCIL_TEXTURE_MODE for the texture is STENCIL_INDEX and either the
         magnification filter or the minification filter is not NEAREST."'

Other than that, this series looks great.  Patch 2 is

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140224/5209f1d2/attachment.pgp>


More information about the mesa-dev mailing list