From: Jason Ekstrand Date: Fri, 6 Mar 2020 22:21:30 +0000 (-0600) Subject: anv/blorp: Do less hard-coding of aux usages X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=86ded00c4021e015ac38a3274309414b2e0b6caa;p=mesa.git anv/blorp: Do less hard-coding of aux usages Reviewed-by: Rafael Antognolli Part-of: --- diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c index 97ef5f98051..8570879f37a 100644 --- a/src/intel/vulkan/anv_blorp.c +++ b/src/intel/vulkan/anv_blorp.c @@ -1628,8 +1628,8 @@ anv_image_hiz_op(struct anv_cmd_buffer *cmd_buffer, { assert(aspect == VK_IMAGE_ASPECT_DEPTH_BIT); assert(base_layer + layer_count <= anv_image_aux_layers(image, aspect, level)); - assert(anv_image_aspect_to_plane(image->aspects, - VK_IMAGE_ASPECT_DEPTH_BIT) == 0); + uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect); + assert(plane == 0); struct blorp_batch batch; blorp_batch_init(&cmd_buffer->device->blorp, &batch, cmd_buffer, 0); @@ -1638,7 +1638,7 @@ anv_image_hiz_op(struct anv_cmd_buffer *cmd_buffer, get_blorp_surf_for_anv_image(cmd_buffer->device, image, VK_IMAGE_ASPECT_DEPTH_BIT, 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX, - ISL_AUX_USAGE_HIZ, &surf); + image->planes[plane].aux_usage, &surf); surf.clear_color.f32[0] = ANV_HZ_FC_VAL; blorp_hiz_op(&batch, &surf, level, base_layer, layer_count, hiz_op); @@ -1662,21 +1662,25 @@ anv_image_hiz_clear(struct anv_cmd_buffer *cmd_buffer, struct blorp_surf depth = {}; if (aspects & VK_IMAGE_ASPECT_DEPTH_BIT) { + uint32_t plane = anv_image_aspect_to_plane(image->aspects, + VK_IMAGE_ASPECT_DEPTH_BIT); assert(base_layer + layer_count <= anv_image_aux_layers(image, VK_IMAGE_ASPECT_DEPTH_BIT, level)); get_blorp_surf_for_anv_image(cmd_buffer->device, image, VK_IMAGE_ASPECT_DEPTH_BIT, 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX, - ISL_AUX_USAGE_HIZ, &depth); + image->planes[plane].aux_usage, &depth); depth.clear_color.f32[0] = ANV_HZ_FC_VAL; } struct blorp_surf stencil = {}; if (aspects & VK_IMAGE_ASPECT_STENCIL_BIT) { + uint32_t plane = anv_image_aspect_to_plane(image->aspects, + VK_IMAGE_ASPECT_STENCIL_BIT); get_blorp_surf_for_anv_image(cmd_buffer->device, image, VK_IMAGE_ASPECT_STENCIL_BIT, 0, ANV_IMAGE_LAYOUT_EXPLICIT_AUX, - ISL_AUX_USAGE_NONE, &stencil); + image->planes[plane].aux_usage, &stencil); } /* From the Sky Lake PRM Volume 7, "Depth Buffer Clear":