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)
{
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;

View File

@@ -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);