mesa/src/mapi
Kenneth Graunke 23e81b93bb mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3).
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>
2014-03-04 17:21:06 -08:00
..
es1api build: Share the all-local rule for linking libraries into the build dir 2014-01-29 12:58:13 -08:00
es2api build: Share the all-local rule for linking libraries into the build dir 2014-01-29 12:58:13 -08:00
glapi mesa: Add core API support for GL_ARB_stencil_texturing (from 4.3). 2014-03-04 17:21:06 -08:00
shared-glapi configure: Try pkg-config first for libselinux 2014-02-17 21:14:16 +00:00
vgapi configure: Try pkg-config first for libselinux 2014-02-17 21:14:16 +00:00
Android.mk build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
entry.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
entry.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
entry_x86-64_tls.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
entry_x86_tls.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
entry_x86_tsd.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
Makefile.am build: Get rid of CORE_DIRS 2013-04-15 12:04:25 -07:00
Makefile.sources build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
mapi.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
mapi.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
mapi_abi.py mesa: Fix build with older gcc since update of glext.h 2013-06-28 08:49:06 -07:00
mapi_glapi.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
mapi_tmp.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
stub.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
stub.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
table.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
table.h mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
u_compiler.h build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
u_current.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
u_current.h build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
u_execmem.c mesa: remove outdated version lines in comments 2013-06-05 08:54:27 -06:00
u_execmem.h build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
u_macros.h build: Move src/mapi/mapi/* to src/mapi/ 2013-04-15 12:04:25 -07:00
u_thread.h mapi/u_thread: Use GetCurrentThreadId 2014-03-04 12:05:23 +00:00