From beb0ea24696821d42b336a8170a61eb25c5022d7 Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Thu, 20 Jun 2024 18:16:52 -0700 Subject: [PATCH] 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 Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/anv_image.c | 21 ++++++++++++--------- src/intel/vulkan/anv_private.h | 4 ++++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 94657acc014..21bafcc0299 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -598,6 +598,8 @@ add_aux_state_tracking_buffer(struct anv_device *device, uint32_t plane) { 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 && image->vk.aspects & (VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV | VK_IMAGE_ASPECT_DEPTH_BIT)); @@ -770,10 +772,11 @@ add_aux_surface_if_supported(struct anv_device *device, return result; } - if (image->planes[plane].aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT) - return add_aux_state_tracking_buffer(device, image, - aux_state_offset, + if (device->info->ver == 12 && + image->planes[plane].aux_usage == ISL_AUX_USAGE_HIZ_CCS_WT) { + return add_aux_state_tracking_buffer(device, image, aux_state_offset, plane); + } } else if (aspect == VK_IMAGE_ASPECT_STENCIL_BIT) { if (!isl_surf_supports_ccs(&device->isl_dev, &image->planes[plane].primary_surface.isl, @@ -847,9 +850,9 @@ add_aux_surface_if_supported(struct anv_device *device, if (result != VK_SUCCESS) return result; - return add_aux_state_tracking_buffer(device, image, - aux_state_offset, - plane); + if (device->info->ver <= 12) + return add_aux_state_tracking_buffer(device, image, aux_state_offset, + plane); } else if ((aspect & VK_IMAGE_ASPECT_ANY_COLOR_BIT_ANV) && image->vk.samples > 1) { assert(!(image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT)); ok = isl_surf_get_mcs_surf(&device->isl_dev, @@ -865,9 +868,9 @@ add_aux_surface_if_supported(struct anv_device *device, if (result != VK_SUCCESS) return result; - return add_aux_state_tracking_buffer(device, image, - aux_state_offset, - plane); + if (device->info->ver <= 12) + return add_aux_state_tracking_buffer(device, image, aux_state_offset, + plane); } return VK_SUCCESS; diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 13f87f575c3..e65a8154d09 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -5463,6 +5463,8 @@ anv_image_get_fast_clear_type_addr(const struct anv_device *device, const struct anv_image *image, VkImageAspectFlagBits aspect) { + /* Xe2+ platforms don't need fast clear type. We shouldn't get here. */ + assert(device->info->ver < 20); struct anv_address addr = 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, 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(array_layer < anv_image_aux_layers(image, aspect, level)); UNUSED uint32_t plane = anv_image_aspect_to_plane(image, aspect);