c/client: Use correct format in get_swapchain_create_properties funtions

This commit is contained in:
Jakob Bornecrantz 2023-04-07 19:08:04 +01:00
parent 94c9c8a253
commit 1adf46b02a
3 changed files with 29 additions and 2 deletions

View file

@ -691,7 +691,16 @@ client_d3d11_compositor_get_swapchain_create_properties(struct xrt_compositor *x
{
struct client_d3d11_compositor *c = as_client_d3d11_compositor(xc);
return xrt_comp_get_swapchain_create_properties(&c->xcn->base, info, xsccp);
int64_t vk_format = d3d_dxgi_format_to_vk((DXGI_FORMAT)info->format);
if (vk_format == 0) {
D3D_ERROR(c, "Invalid format!");
return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
}
struct xrt_swapchain_create_info xinfo = *info;
xinfo.format = vk_format;
return xrt_comp_get_swapchain_create_properties(&c->xcn->base, &xinfo, xsccp);
}
static xrt_result_t

View file

@ -791,7 +791,16 @@ client_d3d12_compositor_get_swapchain_create_properties(struct xrt_compositor *x
{
struct client_d3d12_compositor *c = as_client_d3d12_compositor(xc);
return xrt_comp_get_swapchain_create_properties(&c->xcn->base, info, xsccp);
int64_t vk_format = d3d_dxgi_format_to_vk((DXGI_FORMAT)info->format);
if (vk_format == 0) {
D3D_ERROR(c, "Invalid format!");
return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
}
struct xrt_swapchain_create_info xinfo = *info;
xinfo.format = vk_format;
return xrt_comp_get_swapchain_create_properties(&c->xcn->base, &xinfo, xsccp);
}
static xrt_result_t

View file

@ -398,6 +398,15 @@ client_gl_compositor_get_swapchain_create_properties(struct xrt_compositor *xc,
{
struct client_gl_compositor *c = client_gl_compositor(xc);
int64_t vk_format = gl_format_to_vk(info->format);
if (vk_format == 0) {
U_LOG_E("Invalid format!");
return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
}
struct xrt_swapchain_create_info vkinfo = *info;
vkinfo.format = vk_format;
return xrt_comp_get_swapchain_create_properties(&c->xcn->base, info, xsccp);
}