[Mesa-dev] [PATCH 3/3] mesa/st: pass stencil sampling flag along in pipe_sampler_view

Ilia Mirkin imirkin at alum.mit.edu
Fri May 2 19:42:34 PDT 2014


Also enable ARB_stencil_texturing when PIPE_CAP_STENCIL_SAMPLING is set.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/mesa/state_tracker/st_atom_texture.c | 3 +++
 src/mesa/state_tracker/st_extensions.c   | 1 +
 2 files changed, 4 insertions(+)

diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index afc6d9d..21c965b 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -253,6 +253,8 @@ st_create_texture_sampler_view_from_stobj(struct pipe_context *pipe,
       templ.swizzle_a = GET_SWZ(swizzle, 3);
    }
 
+   templ.stencil_sampling = stObj->base.StencilSampling;
+
    return pipe->create_sampler_view(pipe, stObj->pt, &templ);
 }
 
@@ -275,6 +277,7 @@ st_get_texture_sampler_view_from_stobj(struct st_context *st,
    if (*sv) {
       if (check_sampler_swizzle(stObj, *sv) ||
 	  (format != (*sv)->format) ||
+          stObj->base.StencilSampling != (*sv)->stencil_sampling ||
 	  stObj->base.BaseLevel != (*sv)->u.tex.first_level) {
 	 pipe_sampler_view_reference(sv, NULL);
       }
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index 33cd129..16e25c1 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -427,6 +427,7 @@ void st_init_extensions(struct st_context *st)
       { o(ARB_texture_multisample),          PIPE_CAP_TEXTURE_MULTISAMPLE              },
       { o(ARB_texture_query_lod),            PIPE_CAP_TEXTURE_QUERY_LOD                },
       { o(ARB_sample_shading),               PIPE_CAP_SAMPLE_SHADING                   },
+      { o(ARB_stencil_texturing),            PIPE_CAP_STENCIL_SAMPLING                 },
    };
 
    /* Required: render target and sampler support */
-- 
1.8.3.2



More information about the mesa-dev mailing list