From 2a9c65a01d133fe196fd6e40affb431295d0b9cc Mon Sep 17 00:00:00 2001 From: Jordan Justen Date: Sat, 11 Jun 2016 16:21:36 -0700 Subject: i965/gen7: Add R8_UINT stencil miptree copy for sampling For gen < 8, we can't sample from the stencil buffer, which is required for the ARB_stencil_texturing extension. We'll make a copy of the stencil data into a new texture that we can sample using the R8_UINT surface type. Signed-off-by: Jordan Justen Reviewed-by: Ian Romanick Reviewed-by: Topi Pohjolainen --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/drivers/dri/i965/intel_mipmap_tree.c') diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 5fe6e47..d4f6c34 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -534,6 +534,7 @@ intel_miptree_create_layout(struct brw_context *brw, intel_miptree_release(&mt); return NULL; } + mt->stencil_mt->r8stencil_needs_update = true; /* Fix up the Z miptree format for how we're splitting out separate * stencil. Gen7 expects there to be no stencil bits in its depth buffer. @@ -997,6 +998,7 @@ intel_miptree_release(struct intel_mipmap_tree **mt) drm_intel_bo_unreference((*mt)->bo); intel_miptree_release(&(*mt)->stencil_mt); + intel_miptree_release(&(*mt)->r8stencil_mt); if ((*mt)->hiz_buf) { if ((*mt)->hiz_buf->mt) intel_miptree_release(&(*mt)->hiz_buf->mt); -- cgit v1.1