The open source OpenXR runtime
0
fork

Configure Feed

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

c/client: Fix eglDestroyImageKHR error and add AHB buffer release

authored by

zhibin wang and committed by
Jakob Bornecrantz
828dacc1 985fbe4e

+9 -2
+9 -2
src/xrt/compositor/client/comp_gl_eglimage_swapchain.c
··· 17 17 #include "util/u_misc.h" 18 18 #include "util/u_logging.h" 19 19 #include "util/u_debug.h" 20 + #include "util/u_handles.h" 20 21 21 22 #include <xrt/xrt_config_have.h> 22 23 #include <xrt/xrt_config_os.h> ··· 73 74 glDeleteTextures(image_count, &sc->base.base.images[0]); 74 75 U_ZERO_ARRAY(sc->base.base.images); 75 76 for (uint32_t i = 0; i < image_count; ++i) { 76 - if (sc->egl_images[i] != NULL) { 77 - eglDestroyImageKHR(sc->display, &(sc->egl_images[i])); 77 + if (sc->egl_images[i] == EGL_NO_IMAGE_KHR) { 78 + continue; 78 79 } 80 + eglDestroyImageKHR(sc->display, sc->egl_images[i]); 81 + sc->egl_images[i] = EGL_NO_IMAGE_KHR; 79 82 } 80 83 U_ZERO_ARRAY(sc->egl_images); 81 84 } ··· 85 88 client_gl_eglimage_swapchain_destroy(struct xrt_swapchain *xsc) 86 89 { 87 90 struct client_gl_eglimage_swapchain *sc = client_gl_eglimage_swapchain(xsc); 91 + uint32_t image_count = sc->base.base.base.image_count; 88 92 89 93 client_gl_eglimage_swapchain_teardown_storage(sc); 94 + for (uint32_t i = 0; i < image_count; i++) { 95 + u_graphics_buffer_unref(&sc->base.xscn->images[i].handle); 96 + } 90 97 sc->base.base.base.image_count = 0; 91 98 92 99 // Drop our reference, does NULL checking.