summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_image.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-07-11 11:07:45 -0700
committerJason Ekstrand <[email protected]>2017-07-22 21:41:12 -0700
commit6874b953f6f9762fd8e7abf959aed09ab15693c5 (patch)
tree6c67b7a191a6fbc080e41119d2e8a0b17286401a /src/intel/vulkan/anv_image.c
parenta1cad8218e0c76be3d45191f90e7f5c205bd2bb6 (diff)
anv/image: zalloc image views
This allows us to avoid some extra zeroing. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r--src/intel/vulkan/anv_image.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 2e47b22ec6a..4f0a818b086 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -661,7 +661,7 @@ anv_CreateImageView(VkDevice _device,
ANV_FROM_HANDLE(anv_image, image, pCreateInfo->image);
struct anv_image_view *iview;
- iview = vk_alloc2(&device->alloc, pAllocator, sizeof(*iview), 8,
+ iview = vk_zalloc2(&device->alloc, pAllocator, sizeof(*iview), 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (iview == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
@@ -788,9 +788,6 @@ anv_CreateImageView(VkDevice _device,
anv_state_flush(device, iview->optimal_sampler_surface_state);
anv_state_flush(device, iview->general_sampler_surface_state);
- } else {
- iview->optimal_sampler_surface_state.alloc_size = 0;
- iview->general_sampler_surface_state.alloc_size = 0;
}
/* NOTE: This one needs to go last since it may stomp isl_view.format */
@@ -841,9 +838,6 @@ anv_CreateImageView(VkDevice _device,
anv_state_flush(device, iview->storage_surface_state);
anv_state_flush(device, iview->writeonly_storage_surface_state);
- } else {
- iview->storage_surface_state.alloc_size = 0;
- iview->writeonly_storage_surface_state.alloc_size = 0;
}
*pView = anv_image_view_to_handle(iview);