From c942faf8f37d14e7934a21c15ad2438dde2d501e Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 21 Mar 2017 17:16:46 -0700 Subject: [PATCH] anv/image: Return early when unbinding an image Found by inspection. Reviewed-by: Chad Versace Reviewed-by: Iago Toral Quiroga Cc: "17.0 13.0" --- src/intel/vulkan/anv_image.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 7be988ab814..33499abca1a 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -335,14 +335,15 @@ VkResult anv_BindImageMemory( ANV_FROM_HANDLE(anv_device_memory, mem, _memory); ANV_FROM_HANDLE(anv_image, image, _image); - if (mem) { - image->bo = &mem->bo; - image->offset = memoryOffset; - } else { + if (mem == NULL) { image->bo = NULL; image->offset = 0; + return VK_SUCCESS; } + image->bo = &mem->bo; + image->offset = memoryOffset; + if (image->aux_surface.isl.size > 0) { /* The offset and size must be a multiple of 4K or else the -- 2.30.2