Kenneth Graunke <kenn...@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 <e...@anholt.net>

Attachment: pgp8fZNF2zpJt.pgp
Description: PGP signature

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to