* value (SKL+), define the clear value to the optimal constant.
*/
union isl_color_value default_clear_color = { .u32 = { 0, } };
- if (device->info.gen >= 9 && aux_usage == ISL_AUX_USAGE_HIZ)
+ if (device->info.gen >= 9 && aspect == VK_IMAGE_ASPECT_DEPTH_BIT)
default_clear_color.f32[0] = ANV_HZ_FC_VAL;
if (!clear_color)
clear_color = &default_clear_color;
struct anv_address clear_address = ANV_NULL_ADDRESS;
if (device->info.gen >= 10 && aux_usage != ISL_AUX_USAGE_NONE) {
- if (aux_usage == ISL_AUX_USAGE_HIZ) {
+ if (aspect == VK_IMAGE_ASPECT_DEPTH_BIT) {
clear_address = (struct anv_address) {
.bo = device->hiz_clear_bo,
.offset = 0,
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT,
layout);
- cmd_buffer->state.hiz_enabled = aux_usage == ISL_AUX_USAGE_HIZ;
+ cmd_buffer->state.hiz_enabled = isl_aux_usage_has_hiz(aux_usage);
}
}
const uint32_t ds =
cmd_buffer->state.subpass->depth_stencil_attachment->attachment;
info.hiz_usage = cmd_buffer->state.attachments[ds].aux_usage;
- if (info.hiz_usage == ISL_AUX_USAGE_HIZ) {
+ if (info.hiz_usage != ISL_AUX_USAGE_NONE) {
+ assert(isl_aux_usage_has_hiz(info.hiz_usage));
info.hiz_surf = &image->planes[depth_plane].aux_surface.isl;
info.hiz_address =
(struct anv_address) { cmd_buffer->device->workaround_bo, 0 };
}
}
- cmd_buffer->state.hiz_enabled = info.hiz_usage == ISL_AUX_USAGE_HIZ;
+ cmd_buffer->state.hiz_enabled = isl_aux_usage_has_hiz(info.hiz_usage);
}
/**
if (att_state->fast_clear && !is_multiview) {
/* We currently only support HiZ for single-LOD images */
if (att_state->pending_clear_aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
- assert(iview->image->planes[0].aux_usage == ISL_AUX_USAGE_HIZ);
+ assert(isl_aux_usage_has_hiz(iview->image->planes[0].aux_usage));
assert(iview->planes[0].isl.base_level == 0);
}