summaryrefslogtreecommitdiff
authorIlia Mirkin <imirkin@alum.mit.edu>2014-05-03 09:08:53 (GMT)
committer Ilia Mirkin <imirkin@alum.mit.edu>2014-05-05 00:10:14 (GMT)
commit833f870d9b9f437293fc7ee7fdf4dd428eb5db70 (patch) (side-by-side diff)
tree7c32a3b4bbf9968f1fbd746f85f7426ab8e06cdd
parentcee22a0b48a3d52996d8a660ad1918b325f4a24e (diff)
downloadmesa-833f870d9b9f437293fc7ee7fdf4dd428eb5db70.zip
mesa-833f870d9b9f437293fc7ee7fdf4dd428eb5db70.tar.gz
mesa/st: implement ARB_stencil_texturing
If StencilSampling is enabled on the texture object, pass in an equivalent stencil-only format. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c4
-rw-r--r--src/mesa/state_tracker/st_extensions.c5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index afc6d9d..928a4ff 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -271,6 +271,10 @@ st_get_texture_sampler_view_from_stobj(struct st_context *st,
sv = st_texture_get_sampler_view(st, stObj);
+ if (stObj->base.StencilSampling &&
+ util_format_is_depth_and_stencil(format))
+ format = util_format_stencil_only(format);
+
/* if sampler view has changed dereference it */
if (*sv) {
if (check_sampler_swizzle(stObj, *sv) ||
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 33cd129..12ba82d 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -507,6 +507,11 @@ void st_init_extensions(struct st_context *st)
{ { o(OES_compressed_ETC1_RGB8_texture) },
{ PIPE_FORMAT_ETC1_RGB8 } },
+
+ { { o(ARB_stencil_texturing) },
+ { PIPE_FORMAT_X24S8_UINT,
+ PIPE_FORMAT_S8X24_UINT },
+ GL_TRUE }, /* at least one format must be supported */
};
/* Required: vertex fetch support. */