Commit b64b6f75 authored by Christoph Haag's avatar Christoph Haag Committed by Jakob Bornecrantz
Browse files

comp: Return proper errors for OpenGL xrCreateSwapchain

parent cb352839
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment