diff options
author | Chih-Wei Huang <cwhuang@linux.org.tw> | 2016-11-25 12:05:07 +0800 |
---|---|---|
committer | Chih-Wei Huang <cwhuang@linux.org.tw> | 2016-11-25 12:05:07 +0800 |
commit | 524121d42bfdf8c1bd3565bd2adb0ffd7b52713f (patch) | |
tree | 57b645909523126d571949a0cabb16087aca9849 /src/intel/vulkan/anv_image.c | |
parent | 5d0d07d402fa0edead26450fb86111292e8f834f (diff) | |
parent | f7b58a378ca94cf1c2637d640ce5b9fb8f8519a6 (diff) | |
download | external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.zip external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.gz external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.bz2 |
Merge remote-tracking branch 'mesa/13.0' into nougat-x86
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index b7c2e99..4a4d87e 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -275,8 +275,12 @@ anv_DestroyImage(VkDevice _device, VkImage _image, const VkAllocationCallbacks *pAllocator) { ANV_FROM_HANDLE(anv_device, device, _device); + ANV_FROM_HANDLE(anv_image, image, _image); + + if (!image) + return; - vk_free2(&device->alloc, pAllocator, anv_image_from_handle(_image)); + vk_free2(&device->alloc, pAllocator, image); } VkResult anv_BindImageMemory( @@ -565,6 +569,9 @@ anv_DestroyImageView(VkDevice _device, VkImageView _iview, ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_image_view, iview, _iview); + if (!iview) + return; + if (iview->color_rt_surface_state.alloc_size > 0) { anv_state_pool_free(&device->surface_state_pool, iview->color_rt_surface_state); @@ -655,6 +662,9 @@ anv_DestroyBufferView(VkDevice _device, VkBufferView bufferView, ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(anv_buffer_view, view, bufferView); + if (!view) + return; + if (view->surface_state.alloc_size > 0) anv_state_pool_free(&device->surface_state_pool, view->surface_state); |