mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-03-11 17:50:32 +01:00
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.
v2: Also consider textures incomplete when sampling stencil with
non-NEAREST min/mag filters (caught by Eric Anholt).
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
|
||
|---|---|---|
| .. | ||
| es1api | ||
| es2api | ||
| glapi | ||
| shared-glapi | ||
| vgapi | ||
| Android.mk | ||
| entry.c | ||
| entry.h | ||
| entry_x86-64_tls.h | ||
| entry_x86_tls.h | ||
| entry_x86_tsd.h | ||
| Makefile.am | ||
| Makefile.sources | ||
| mapi.c | ||
| mapi.h | ||
| mapi_abi.py | ||
| mapi_glapi.c | ||
| mapi_tmp.h | ||
| stub.c | ||
| stub.h | ||
| table.c | ||
| table.h | ||
| u_compiler.h | ||
| u_current.c | ||
| u_current.h | ||
| u_execmem.c | ||
| u_execmem.h | ||
| u_macros.h | ||
| u_thread.h | ||