mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 03:20:09 +01:00
i965/mt: Disable HiZ when sharing depth buffer externally (v2)
intel_miptree_make_shareable() discarded and disabled CCS. Fix it so
that it discards and disables HiZ too.
Fixes dEQP-EGL.functional.image.render_multiple_contexts.gles2_renderbuffer_depth16_depth_buffer
on Skylake.
v2: Actually do what the commit message says. Discard the HiZ buffer.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=98329
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: Nanley Chery <nanley.g.chery@intel.com
Cc: Haixia Shi <hshi@chromium.org>
(cherry picked from commit 42011be1e2)
[Emil Velikov: patch is a backport by Chad of above commit]
This commit is contained in:
parent
3c7b53bba3
commit
febf22ff55
1 changed files with 22 additions and 7 deletions
|
|
@ -984,6 +984,19 @@ intel_miptree_reference(struct intel_mipmap_tree **dst,
|
|||
*dst = src;
|
||||
}
|
||||
|
||||
static void
|
||||
intel_miptree_hiz_buffer_free(struct intel_miptree_aux_buffer *hiz_buf)
|
||||
{
|
||||
if (hiz_buf == NULL)
|
||||
return;
|
||||
|
||||
if (hiz_buf->mt)
|
||||
intel_miptree_release(&hiz_buf->mt);
|
||||
else
|
||||
drm_intel_bo_unreference(hiz_buf->bo);
|
||||
|
||||
free(hiz_buf);
|
||||
}
|
||||
|
||||
void
|
||||
intel_miptree_release(struct intel_mipmap_tree **mt)
|
||||
|
|
@ -999,13 +1012,7 @@ intel_miptree_release(struct intel_mipmap_tree **mt)
|
|||
|
||||
drm_intel_bo_unreference((*mt)->bo);
|
||||
intel_miptree_release(&(*mt)->stencil_mt);
|
||||
if ((*mt)->hiz_buf) {
|
||||
if ((*mt)->hiz_buf->mt)
|
||||
intel_miptree_release(&(*mt)->hiz_buf->mt);
|
||||
else
|
||||
drm_intel_bo_unreference((*mt)->hiz_buf->bo);
|
||||
free((*mt)->hiz_buf);
|
||||
}
|
||||
intel_miptree_hiz_buffer_free((*mt)->hiz_buf);
|
||||
intel_miptree_release(&(*mt)->mcs_mt);
|
||||
intel_resolve_map_clear(&(*mt)->hiz_map);
|
||||
|
||||
|
|
@ -2184,6 +2191,8 @@ intel_miptree_resolve_color(struct brw_context *brw,
|
|||
* then discard the MCS buffer, if present. We also set the fast_clear_state
|
||||
* to INTEL_FAST_CLEAR_STATE_NO_MCS to ensure that no MCS buffer gets
|
||||
* allocated in the future.
|
||||
*
|
||||
* HiZ is similarly unsafe with shared buffers.
|
||||
*/
|
||||
void
|
||||
intel_miptree_make_shareable(struct brw_context *brw,
|
||||
|
|
@ -2202,6 +2211,12 @@ intel_miptree_make_shareable(struct brw_context *brw,
|
|||
mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_NO_MCS;
|
||||
}
|
||||
|
||||
if (mt->hiz_buf) {
|
||||
intel_miptree_all_slices_resolve_depth(brw, mt);
|
||||
intel_miptree_hiz_buffer_free(mt->hiz_buf);
|
||||
mt->hiz_buf = NULL;
|
||||
}
|
||||
|
||||
mt->disable_aux_buffers = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue