mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-03 21:26:36 +00:00
c/client: Set correct reference on swapchain
This commit is contained in:
parent
7c77625da9
commit
7dc132a207
src/xrt/compositor/client
|
@ -193,15 +193,14 @@ client_gl_eglimage_swapchain_create(struct xrt_compositor *xc,
|
|||
struct xrt_swapchain *native_xsc = &xscn->base;
|
||||
|
||||
struct client_gl_eglimage_swapchain *sc = U_TYPED_CALLOC(struct client_gl_eglimage_swapchain);
|
||||
struct xrt_swapchain_gl *xscgl = &sc->base.base;
|
||||
struct xrt_swapchain *client_xsc = &xscgl->base;
|
||||
client_xsc->destroy = client_gl_eglimage_swapchain_destroy;
|
||||
// Fetch the number of images from the native swapchain.
|
||||
client_xsc->num_images = native_xsc->num_images;
|
||||
sc->base.base.base.destroy = client_gl_eglimage_swapchain_destroy;
|
||||
sc->base.base.base.reference.count = 1;
|
||||
sc->base.base.base.num_images = native_xsc->num_images; // Fetch the number of images from the native swapchain.
|
||||
sc->base.xscn = xscn;
|
||||
|
||||
sc->display = eglGetCurrentDisplay();
|
||||
|
||||
struct xrt_swapchain_gl *xscgl = &sc->base.base;
|
||||
|
||||
glGenTextures(native_xsc->num_images, xscgl->images);
|
||||
|
||||
GLuint binding_enum = 0;
|
||||
|
|
|
@ -60,6 +60,7 @@ client_gl_memobj_swapchain_destroy(struct xrt_swapchain *xsc)
|
|||
|
||||
free(sc);
|
||||
}
|
||||
|
||||
struct xrt_swapchain *
|
||||
client_gl_memobj_swapchain_create(struct xrt_compositor *xc,
|
||||
const struct xrt_swapchain_create_info *info,
|
||||
|
|
|
@ -92,6 +92,7 @@ client_vk_swapchain_acquire_image(struct xrt_swapchain *xsc, uint32_t *out_index
|
|||
VK_ERROR(vk, "Could not submit to queue: %d", ret);
|
||||
return XRT_ERROR_FAILED_TO_SUBMIT_VULKAN_COMMANDS;
|
||||
}
|
||||
|
||||
return XRT_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -392,8 +393,8 @@ client_vk_swapchain_create(struct xrt_compositor *xc,
|
|||
sc->base.base.acquire_image = client_vk_swapchain_acquire_image;
|
||||
sc->base.base.wait_image = client_vk_swapchain_wait_image;
|
||||
sc->base.base.release_image = client_vk_swapchain_release_image;
|
||||
// Fetch the number of images from the native swapchain.
|
||||
sc->base.base.num_images = xsc->num_images;
|
||||
sc->base.base.reference.count = 1;
|
||||
sc->base.base.num_images = xsc->num_images; // Fetch the number of images from the native swapchain.
|
||||
sc->c = c;
|
||||
sc->xscn = xscn;
|
||||
|
||||
|
|
Loading…
Reference in a new issue