c/client: Implement transition image stubs

This commit is contained in:
Jakob Bornecrantz 2023-03-23 22:51:23 +00:00
parent b7362f27e6
commit 0d21b73b05
4 changed files with 33 additions and 3 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2019-2022, Collabora, Ltd.
// Copyright 2019-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@ -292,6 +292,12 @@ client_d3d11_swapchain_wait_image(struct xrt_swapchain *xsc, uint64_t timeout_ns
return xret;
}
static xrt_result_t
client_d3d11_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
{
return XRT_SUCCESS;
}
static xrt_result_t
client_d3d11_swapchain_release_image(struct xrt_swapchain *xsc, uint32_t index)
{
@ -436,6 +442,7 @@ try {
sc->base.base.destroy = client_d3d11_swapchain_destroy;
sc->base.base.acquire_image = client_d3d11_swapchain_acquire_image;
sc->base.base.wait_image = client_d3d11_swapchain_wait_image;
sc->base.base.barrier_image = client_d3d11_swapchain_barrier_image;
sc->base.base.release_image = client_d3d11_swapchain_release_image;
sc->c = c;
sc->base.base.image_count = image_count;

View file

@ -1,4 +1,4 @@
// Copyright 2019-2022, Collabora, Ltd.
// Copyright 2019-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@ -366,6 +366,12 @@ client_d3d12_swapchain_wait_image(struct xrt_swapchain *xsc, uint64_t timeout_ns
return xret;
}
static xrt_result_t
client_d3d12_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
{
return XRT_SUCCESS;
}
static xrt_result_t
client_d3d12_swapchain_release_image(struct xrt_swapchain *xsc, uint32_t index)
{
@ -537,6 +543,7 @@ try {
sc->base.base.destroy = client_d3d12_swapchain_destroy;
sc->base.base.acquire_image = client_d3d12_swapchain_acquire_image;
sc->base.base.wait_image = client_d3d12_swapchain_wait_image;
sc->base.base.barrier_image = client_d3d12_swapchain_barrier_image;
sc->base.base.release_image = client_d3d12_swapchain_release_image;
sc->c = c;
sc->base.base.image_count = image_count;

View file

@ -1,4 +1,4 @@
// Copyright 2019-2021, Collabora, Ltd.
// Copyright 2019-2023, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
@ -151,6 +151,12 @@ client_gl_swapchain_wait_image(struct xrt_swapchain *xsc, uint64_t timeout_ns, u
return xrt_swapchain_wait_image(&sc->xscn->base, timeout_ns, index);
}
static xrt_result_t
client_gl_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
{
return XRT_SUCCESS;
}
static xrt_result_t
client_gl_swapchain_release_image(struct xrt_swapchain *xsc, uint32_t index)
{
@ -494,6 +500,9 @@ client_gl_swapchain_create(struct xrt_compositor *xc,
if (NULL == sc->base.base.wait_image) {
sc->base.base.wait_image = client_gl_swapchain_wait_image;
}
if (NULL == sc->base.base.barrier_image) {
sc->base.base.barrier_image = client_gl_swapchain_barrier_image;
}
if (NULL == sc->base.base.release_image) {
sc->base.base.release_image = client_gl_swapchain_release_image;
}

View file

@ -294,6 +294,12 @@ client_vk_swapchain_wait_image(struct xrt_swapchain *xsc, uint64_t timeout_ns, u
return xrt_swapchain_wait_image(&sc->xscn->base, timeout_ns, index);
}
static xrt_result_t
client_vk_swapchain_barrier_image(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
{
return XRT_SUCCESS;
}
static xrt_result_t
client_vk_swapchain_release_image(struct xrt_swapchain *xsc, uint32_t index)
{
@ -632,6 +638,7 @@ client_vk_swapchain_create(struct xrt_compositor *xc,
sc->base.base.destroy = client_vk_swapchain_destroy;
sc->base.base.acquire_image = client_vk_swapchain_acquire_image;
sc->base.base.wait_image = client_vk_swapchain_wait_image;
sc->base.base.barrier_image = client_vk_swapchain_barrier_image;
sc->base.base.release_image = client_vk_swapchain_release_image;
sc->base.base.reference.count = 1;
sc->base.base.image_count = xsc->image_count; // Fetch the number of images from the native swapchain.