From b249af9415ce45b8aa7f4bc67b70663ba1690022 Mon Sep 17 00:00:00 2001 From: Christoph Haag Date: Mon, 9 Aug 2021 13:39:59 +0200 Subject: [PATCH] comp: Bind the correct GL texture for importing memory objects --- src/xrt/compositor/client/comp_gl_memobj_swapchain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xrt/compositor/client/comp_gl_memobj_swapchain.c b/src/xrt/compositor/client/comp_gl_memobj_swapchain.c index 6a92c7e5d..53be1b8f6 100644 --- a/src/xrt/compositor/client/comp_gl_memobj_swapchain.c +++ b/src/xrt/compositor/client/comp_gl_memobj_swapchain.c @@ -90,12 +90,11 @@ client_gl_memobj_swapchain_create(struct xrt_compositor *xc, struct xrt_swapchain_gl *xscgl = &sc->base.base; glGenTextures(native_xsc->num_images, xscgl->images); - for (uint32_t i = 0; i < native_xsc->num_images; i++) { - glBindTexture(tex_target, xscgl->images[i]); - } glCreateMemoryObjectsEXT(native_xsc->num_images, &sc->memory[0]); for (uint32_t i = 0; i < native_xsc->num_images; i++) { + glBindTexture(tex_target, xscgl->images[i]); + GLint dedicated = xscn->images[i].use_dedicated_allocation ? GL_TRUE : GL_FALSE; glMemoryObjectParameterivEXT(sc->memory[i], GL_DEDICATED_MEMORY_OBJECT_EXT, &dedicated); glImportMemoryFdEXT(sc->memory[i], xscn->images[i].size, GL_HANDLE_TYPE_OPAQUE_FD_EXT,