anv: Drop anv_image::needs_*_surface_state
authorChad Versace <chad.versace@intel.com>
Thu, 4 Feb 2016 19:58:05 +0000 (11:58 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 4 Feb 2016 20:20:51 +0000 (12:20 -0800)
anv_image::needs_sampler_surface_state was a redundant member,
identical to (usage & VK_IMAGE_USAGE_SAMPLED_BIT). Likewise for the
other needs_* members.

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

index be91cdc5d92f2084519a0c79b5b3e3dc6dc9e3e3..da71406cf27864e380541af1f74744c626cd25a0 100644 (file)
@@ -215,18 +215,6 @@ anv_image_create(VkDevice _device,
    image->usage = anv_image_get_full_usage(pCreateInfo);
    image->tiling = pCreateInfo->tiling;
 
-   if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
-      image->needs_sampler_surface_state = true;
-   }
-
-   if (image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
-      image->needs_color_rt_surface_state = true;
-   }
-
-   if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT) {
-      image->needs_storage_surface_state = true;
-   }
-
    if (likely(anv_format_is_color(image->format))) {
       r = make_surface(device, image, create_info,
                        VK_IMAGE_ASPECT_COLOR_BIT);
@@ -570,7 +558,7 @@ anv_image_view_init(struct anv_image_view *iview,
       .depth  = anv_minify(iview->level_0_extent.depth , range->baseMipLevel),
    };
 
-   if (image->needs_sampler_surface_state) {
+   if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT) {
       iview->sampler_surface_state = alloc_surface_state(device, cmd_buffer);
 
       anv_fill_image_surface_state(device, iview->sampler_surface_state,
@@ -580,7 +568,7 @@ anv_image_view_init(struct anv_image_view *iview,
       iview->sampler_surface_state.alloc_size = 0;
    }
 
-   if (image->needs_color_rt_surface_state) {
+   if (image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) {
       iview->color_rt_surface_state = alloc_surface_state(device, cmd_buffer);
 
       anv_fill_image_surface_state(device, iview->color_rt_surface_state,
@@ -590,7 +578,7 @@ anv_image_view_init(struct anv_image_view *iview,
       iview->color_rt_surface_state.alloc_size = 0;
    }
 
-   if (image->needs_storage_surface_state) {
+   if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT) {
       iview->storage_surface_state = alloc_surface_state(device, cmd_buffer);
 
       if (has_matching_storage_typed_format(device, iview->format))
@@ -636,17 +624,17 @@ anv_DestroyImageView(VkDevice _device, VkImageView _iview,
    ANV_FROM_HANDLE(anv_device, device, _device);
    ANV_FROM_HANDLE(anv_image_view, iview, _iview);
 
-   if (iview->image->needs_color_rt_surface_state) {
+   if (iview->color_rt_surface_state.alloc_size > 0) {
       anv_state_pool_free(&device->surface_state_pool,
                           iview->color_rt_surface_state);
    }
 
-   if (iview->image->needs_sampler_surface_state) {
+   if (iview->sampler_surface_state.alloc_size > 0) {
       anv_state_pool_free(&device->surface_state_pool,
                           iview->sampler_surface_state);
    }
 
-   if (iview->image->needs_storage_surface_state) {
+   if (iview->storage_surface_state.alloc_size > 0) {
       anv_state_pool_free(&device->surface_state_pool,
                           iview->storage_surface_state);
    }
index 8c4136b8cfd5d94368650605ff4bec8d54967d67..8e12792456b95c4f391a8e1f4309a5885196d073 100644 (file)
@@ -1552,10 +1552,6 @@ struct anv_image {
    struct anv_bo *bo;
    VkDeviceSize offset;
 
-   bool needs_sampler_surface_state:1;
-   bool needs_color_rt_surface_state:1;
-   bool needs_storage_surface_state:1;
-
    /**
     * Image subsurfaces
     *