mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-03 12:28:07 +00:00
comp: Return proper errors for OpenGL xrCreateSwapchain
This commit is contained in:
parent
cb352839e3
commit
b64b6f75fe
src/xrt
|
@ -354,14 +354,14 @@ client_gl_swapchain_create(struct xrt_compositor *xc,
|
|||
U_LOG_E(
|
||||
"Only one array layer is supported with OpenGL ES "
|
||||
"2");
|
||||
return XRT_ERROR_OPENGL;
|
||||
return XRT_ERROR_SWAPCHAIN_FLAG_VALID_BUT_UNSUPPORTED;
|
||||
}
|
||||
}
|
||||
|
||||
int64_t vk_format = gl_format_to_vk(info->format);
|
||||
if (vk_format == 0) {
|
||||
U_LOG_E("Invalid format!");
|
||||
return XRT_ERROR_VULKAN;
|
||||
return XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED;
|
||||
}
|
||||
|
||||
struct xrt_swapchain_create_info xinfo = *info;
|
||||
|
|
|
@ -48,4 +48,9 @@ typedef enum xrt_result
|
|||
* Multiple not supported on this layer level (IPC, compositor).
|
||||
*/
|
||||
XRT_ERROR_MULTI_SESSION_NOT_IMPLEMENTED = -11,
|
||||
|
||||
/*!
|
||||
* The requested format is not supported by Monado.
|
||||
*/
|
||||
XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED = -12,
|
||||
} xrt_result_t;
|
||||
|
|
|
@ -211,6 +211,9 @@ oxr_create_swapchain(struct oxr_logger *log,
|
|||
return oxr_error(log, XR_ERROR_FEATURE_UNSUPPORTED,
|
||||
"Specified swapchain creation flag is valid, "
|
||||
"but not supported");
|
||||
} else if (xret == XRT_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED) {
|
||||
return oxr_error(log, XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED,
|
||||
"Specified swapchain format is not supported");
|
||||
}
|
||||
if (xret != XRT_SUCCESS) {
|
||||
return oxr_error(log, XR_ERROR_RUNTIME_FAILURE, "Failed to create swapchain");
|
||||
|
|
Loading…
Reference in a new issue