summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Justen <jordan.l.justen@intel.com>2016-06-11 16:41:18 -0700
committerJordan Justen <jordan.l.justen@intel.com>2016-08-18 16:33:49 -0700
commitfc0e87ba38f01029c81df3d2004ea51ab337bbe5 (patch)
tree247a7b7f1d92a8813ab33ff84363fb7b4453972b
parent83875e466780a8398b5365c736ac198e446c260c (diff)
i965/gen7: Use stencil copy when sampling the stencil texture
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
index 9f340ef92de..1298d4e5fc5 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -452,9 +452,17 @@ brw_update_texture_surface(struct gl_context *ctx,
}
if (obj->StencilSampling && firstImage->_BaseFormat == GL_DEPTH_STENCIL) {
- assert(brw->gen >= 8);
- mt = mt->stencil_mt;
+ if (brw->gen == 7) {
+ assert(mt->stencil_tex_mt && !mt->stencil_mt->stencil_tex_needs_update);
+ mt = mt->stencil_tex_mt;
+ } else {
+ assert(brw->gen >= 8);
+ mt = mt->stencil_mt;
+ }
format = BRW_SURFACEFORMAT_R8_UINT;
+ } else if (brw->gen == 7 && mt->format == MESA_FORMAT_S_UINT8) {
+ assert(!mt->stencil_tex_needs_update);
+ mt = mt->stencil_tex_mt;
}
const int surf_index = surf_offset - &brw->wm.base.surf_offset[0];