The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/vk: Use the defines to manually unref android buffers

The import does not consume them

Co-authored-by: Rylie Pavlik <rylie.pavlik@collabora.com>

authored by

yuloliu
Rylie Pavlik
and committed by
Rylie Pavlik
89194630 c763a1cb

+10 -2
+10 -2
src/xrt/auxiliary/vk/vk_helpers.c
··· 1 - // Copyright 2019-2022, Collabora, Ltd. 1 + // Copyright 2019-2023, Collabora, Ltd. 2 2 // SPDX-License-Identifier: BSL-1.0 3 3 /*! 4 4 * @file ··· 21 21 #include <stdlib.h> 22 22 #include <string.h> 23 23 24 + #include "util/u_debug.h" 25 + #include "util/u_handles.h" 24 26 #include "util/u_misc.h" 25 - #include "util/u_debug.h" 26 27 27 28 #include "vk/vk_helpers.h" 28 29 ··· 1193 1194 out_mem, // out_mem 1194 1195 NULL); // out_size 1195 1196 1197 + #if defined(XRT_GRAPHICS_BUFFER_HANDLE_CONSUMED_BY_VULKAN_IMPORT) 1196 1198 // We have consumed this fd now, make sure it's not freed again. 1197 1199 image_native->handle = XRT_GRAPHICS_BUFFER_HANDLE_INVALID; 1200 + #elif defined(XRT_GRAPHICS_BUFFER_HANDLE_REFERENCE_ADDED_BY_VULKAN_IMPORT) 1201 + // Some platforms need an explicit unref (Android) 1202 + u_graphics_buffer_unref(&image_native->handle); 1203 + #else 1204 + #error "Need port!" 1205 + #endif 1198 1206 1199 1207 if (ret != VK_SUCCESS) { 1200 1208 vk->vkDestroyImage(vk->device, image, NULL);