anv: Disable tracking fast clear and aux state (xe2)

Xe2+ doesn't use aux tracking buffers, and we should not
have access to the fast-clear type and compression state.

Signed-off-by: Jianxun Zhang <jianxun.zhang@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29966>
This commit is contained in:
Jianxun Zhang 2024-06-20 18:16:52 -07:00 committed by Marge Bot
parent 01ea13cb6d
commit beb0ea2469
2 changed files with 16 additions and 9 deletions

View file

@ -598,6 +598,8 @@ add_aux_state_tracking_buffer(struct anv_device *device,
uint32_t plane) uint32_t plane)
{ {
assert(image && device); assert(image && device);
/* Xe2+ platforms don't use aux tracking buffers. We shouldn't get here. */
assert(device->info->ver < 20);
assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE && assert(image->planes[plane].aux_usage != ISL_AUX_USAGE_NONE &&
image->vk.aspects & (VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV | image->vk.aspects & (VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV |
VK_IMAGE_ASPECT_DEPTH_BIT)); VK_IMAGE_ASPECT_DEPTH_BIT));
@ -770,10 +772,11 @@ add_aux_surface_if_supported(struct anv_device *device,
return result; return result;
} }
if (image->planes[plane].aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT) if (device->info->ver == 12 &&
return add_aux_state_tracking_buffer(device, image, image->planes[plane].aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT) {
aux_state_offset, return add_aux_state_tracking_buffer(device, image, aux_state_offset,
plane); plane);
}
} else if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT) { } else if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT) {
if (!isl_surf_supports_ccs(&device->isl_dev, if (!isl_surf_supports_ccs(&device->isl_dev,
&image->planes[plane].primary_surface.isl, &image->planes[plane].primary_surface.isl,
@ -847,8 +850,8 @@ add_aux_surface_if_supported(struct anv_device *device,
if (result != VK_SUCCESS) if (result != VK_SUCCESS)
return result; return result;
return add_aux_state_tracking_buffer(device, image, if (device->info->ver <= 12)
aux_state_offset, return add_aux_state_tracking_buffer(device, image, aux_state_offset,
plane); plane);
} else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->vk.samples > 1) { } else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->vk.samples > 1) {
assert(!(image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT)); assert(!(image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT));
@ -865,8 +868,8 @@ add_aux_surface_if_supported(struct anv_device *device,
if (result != VK_SUCCESS) if (result != VK_SUCCESS)
return result; return result;
return add_aux_state_tracking_buffer(device, image, if (device->info->ver <= 12)
aux_state_offset, return add_aux_state_tracking_buffer(device, image, aux_state_offset,
plane); plane);
} }

View file

@ -5463,6 +5463,8 @@ anv_image_get_fast_clear_type_addr(const struct anv_device *device,
const struct anv_image *image, const struct anv_image *image,
VkImageAspectFlagBits aspect) VkImageAspectFlagBits aspect)
{ {
/* Xe2+ platforms don't need fast clear type. We shouldn't get here. */
assert(device->info->ver < 20);
struct anv_address addr = struct anv_address addr =
anv_image_get_clear_color_addr(device, image, aspect); anv_image_get_clear_color_addr(device, image, aspect);
@ -5485,6 +5487,8 @@ anv_image_get_compression_state_addr(const struct anv_device *device,
VkImageAspectFlagBits aspect, VkImageAspectFlagBits aspect,
uint32_t level, uint32_t array_layer) uint32_t level, uint32_t array_layer)
{ {
/* Xe2+ platforms don't use compression state. We shouldn't get here. */
assert(device->info->ver < 20);
assert(level < anv_image_aux_levels(image, aspect)); assert(level < anv_image_aux_levels(image, aspect));
assert(array_layer < anv_image_aux_layers(image, aspect, level)); assert(array_layer < anv_image_aux_layers(image, aspect, level));
UNUSED uint32_t plane = anv_image_aspect_to_plane(image, aspect); UNUSED uint32_t plane = anv_image_aspect_to_plane(image, aspect);