diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 2daf5cb5f61..86cf4a2ac26 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -2359,10 +2359,6 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_BindImageMemory2(VkDevice _device, VkBindMemoryStatusKHR *status = (void*)vk_find_struct_const(&pBindInfos[i], BIND_MEMORY_STATUS_KHR); bool did_bind = false; - if (!mem) { - continue; - } - #ifdef LVP_USE_WSI_PLATFORM vk_foreach_struct_const(s, bind_info->pNext) { switch (s->sType) { @@ -2392,6 +2388,10 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_BindImageMemory2(VkDevice _device, #endif if (!did_bind) { + if (!mem) { + continue; + } + uint64_t offset_B = 0; VkResult result; if (image->disjoint) {