mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 07:58:16 +02:00
anv: set missing protected bit for protected depth/stencil surfaces
This bit is set in mocs for other protected attachment types by
anv_image_fill_surface_state() however was ommited for depth/stencil
attachments here.
Without the protected bit set, it causes heavy black artifacting when
attaching a protected depth attachment image to a framebuffer.
Fixes: 794b0496e9 ("anv: enable protected memory")
Signed-off-by: Juston Li <justonli@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39818>
This commit is contained in:
parent
a16d36304e
commit
f84ed620c2
1 changed files with 10 additions and 2 deletions
|
|
@ -5817,8 +5817,12 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
|
|||
|
||||
info.depth_surf = &depth_surface->isl;
|
||||
info.depth_address = anv_address_physical(depth_address);
|
||||
|
||||
isl_surf_usage_flags_t isl_usage = ISL_SURF_USAGE_DEPTH_BIT;
|
||||
if (anv_image_is_protected(image))
|
||||
isl_usage |= ISL_SURF_USAGE_PROTECTED_BIT;
|
||||
info.mocs =
|
||||
anv_mocs(device, depth_address.bo, ISL_SURF_USAGE_DEPTH_BIT);
|
||||
anv_mocs(device, depth_address.bo, isl_usage);
|
||||
|
||||
info.hiz_usage = gfx->depth_att.aux_usage;
|
||||
if (info.hiz_usage != ISL_AUX_USAGE_NONE) {
|
||||
|
|
@ -5855,8 +5859,12 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
|
|||
|
||||
info.stencil_aux_usage = image->planes[stencil_plane].aux_usage;
|
||||
info.stencil_address = anv_address_physical(stencil_address);
|
||||
|
||||
isl_surf_usage_flags_t isl_usage = ISL_SURF_USAGE_STENCIL_BIT;
|
||||
if (anv_image_is_protected(image))
|
||||
isl_usage |= ISL_SURF_USAGE_PROTECTED_BIT;
|
||||
info.mocs =
|
||||
anv_mocs(device, stencil_address.bo, ISL_SURF_USAGE_STENCIL_BIT);
|
||||
anv_mocs(device, stencil_address.bo, isl_usage);
|
||||
}
|
||||
|
||||
isl_emit_depth_stencil_hiz_s(&device->isl_dev, dw, &info);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue