mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 22:00:13 +01:00
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 <jordan.l.justen@intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
parent
91627d1956
commit
2a9c65a01d
2 changed files with 14 additions and 0 deletions
|
|
@ -534,6 +534,7 @@ intel_miptree_create_layout(struct brw_context *brw,
|
||||||
intel_miptree_release(&mt);
|
intel_miptree_release(&mt);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
mt->stencil_mt->r8stencil_needs_update = true;
|
||||||
|
|
||||||
/* Fix up the Z miptree format for how we're splitting out separate
|
/* 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.
|
* 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);
|
drm_intel_bo_unreference((*mt)->bo);
|
||||||
intel_miptree_release(&(*mt)->stencil_mt);
|
intel_miptree_release(&(*mt)->stencil_mt);
|
||||||
|
intel_miptree_release(&(*mt)->r8stencil_mt);
|
||||||
if ((*mt)->hiz_buf) {
|
if ((*mt)->hiz_buf) {
|
||||||
if ((*mt)->hiz_buf->mt)
|
if ((*mt)->hiz_buf->mt)
|
||||||
intel_miptree_release(&(*mt)->hiz_buf->mt);
|
intel_miptree_release(&(*mt)->hiz_buf->mt);
|
||||||
|
|
|
||||||
|
|
@ -614,6 +614,18 @@ struct intel_mipmap_tree
|
||||||
*/
|
*/
|
||||||
struct intel_mipmap_tree *stencil_mt;
|
struct intel_mipmap_tree *stencil_mt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief Stencil texturing miptree for sampling from a stencil texture
|
||||||
|
*
|
||||||
|
* Some hardware doesn't support sampling from the stencil texture as
|
||||||
|
* required by the GL_ARB_stencil_texturing extenion. To workaround this we
|
||||||
|
* blit the texture into a new texture that can be sampled.
|
||||||
|
*
|
||||||
|
* \see intel_update_r8stencil()
|
||||||
|
*/
|
||||||
|
struct intel_mipmap_tree *r8stencil_mt;
|
||||||
|
bool r8stencil_needs_update;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief MCS miptree.
|
* \brief MCS miptree.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue