anv: Delete anv_image::ccs_e_compatible
authorChad Versace <chadversary@chromium.org>
Thu, 24 Oct 2019 23:00:17 +0000 (16:00 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 12 Feb 2020 20:31:39 +0000 (20:31 +0000)
It was set exactly once, and read exactly once, both times during
anv_image_create().

I found its permanency as a member of anv_image to be distracting while
implementing VK_EXT_image_drm_format_modifier.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3795>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3795>

src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h

index f4c1e693f42c380c525392bfdbcd73bf15ba990f..e55d6b2db8bbe42b0089b9ef8cdadefb9a345f2a 100644 (file)
@@ -308,6 +308,7 @@ add_aux_state_tracking_buffer(struct anv_image *image,
 static VkResult
 make_surface(struct anv_device *device,
              struct anv_image *image,
+             const VkImageFormatListCreateInfoKHR *fmt_list,
              uint32_t stride,
              isl_tiling_flags_t tiling_flags,
              isl_surf_usage_flags_t isl_extra_usage_flags,
@@ -489,7 +490,11 @@ make_surface(struct anv_device *device,
              * compression on at all times for these formats.
              */
             if (!(image->usage & VK_IMAGE_USAGE_STORAGE_BIT) &&
-                image->ccs_e_compatible) {
+                anv_formats_ccs_e_compatible(&device->info,
+                                             image->create_flags,
+                                             image->vk_format,
+                                             image->tiling,
+                                             fmt_list)) {
                image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;
             } else if (device->info.gen >= 12) {
                anv_perf_warn(device, image,
@@ -661,14 +666,11 @@ anv_image_create(VkDevice _device,
       vk_find_struct_const(pCreateInfo->pNext,
                            IMAGE_FORMAT_LIST_CREATE_INFO_KHR);
 
-   image->ccs_e_compatible =
-      anv_formats_ccs_e_compatible(&device->info, image->create_flags,
-                                   image->vk_format, image->tiling, fmt_list);
-
    uint32_t b;
    for_each_bit(b, image->aspects) {
-      r = make_surface(device, image, create_info->stride, isl_tiling_flags,
-                       create_info->isl_extra_usage_flags, (1 << b));
+      r = make_surface(device, image, fmt_list, create_info->stride,
+                       isl_tiling_flags, create_info->isl_extra_usage_flags,
+                       (1 << b));
       if (r != VK_SUCCESS)
          goto fail;
    }
@@ -902,14 +904,13 @@ resolve_ahw_image(struct anv_device *device,
    image->format = anv_get_format(vk_format);
    image->aspects = vk_format_aspects(image->vk_format);
    image->n_planes = image->format->n_planes;
-   image->ccs_e_compatible = false;
 
    uint32_t stride = desc.stride *
                      (isl_format_get_layout(isl_fmt)->bpb / 8);
 
    uint32_t b;
    for_each_bit(b, image->aspects) {
-      VkResult r = make_surface(device, image, stride, isl_tiling_flags,
+      VkResult r = make_surface(device, image, NULL, stride, isl_tiling_flags,
                                 ISL_SURF_USAGE_DISABLE_AUX_BIT, (1 << b));
       assert(r == VK_SUCCESS);
    }
index fa5c7cbf2a030915813c4edb82e155d4669ce57e..828d0f0d954a8beb6f2732e42cabb874d9eb32af 100644 (file)
@@ -3435,11 +3435,6 @@ struct anv_image {
     */
    bool disjoint;
 
-   /* All the formats that can be used when creating views of this image
-    * are CCS_E compatible.
-    */
-   bool ccs_e_compatible;
-
    /* Image was created with external format. */
    bool external_format;