mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-01 03:18:26 +00:00
st/oxr: RenderDoc support on Vulkan/GLES client sides and Android platform
Makes it so RenderDoc can be captured by the button in UI.
This commit is contained in:
parent
b1aedcf1d5
commit
e328c42121
|
@ -150,7 +150,9 @@ oxr_xrBeginFrame(XrSession session, const XrFrameBeginInfo *frameBeginInfo)
|
||||||
|
|
||||||
#ifdef XRT_FEATURE_RENDERDOC
|
#ifdef XRT_FEATURE_RENDERDOC
|
||||||
if (sess->sys->inst->rdoc_api) {
|
if (sess->sys->inst->rdoc_api) {
|
||||||
|
#ifndef XR_USE_PLATFORM_ANDROID
|
||||||
sess->sys->inst->rdoc_api->StartFrameCapture(NULL, NULL);
|
sess->sys->inst->rdoc_api->StartFrameCapture(NULL, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -171,7 +173,9 @@ oxr_xrEndFrame(XrSession session, const XrFrameEndInfo *frameEndInfo)
|
||||||
|
|
||||||
#ifdef XRT_FEATURE_RENDERDOC
|
#ifdef XRT_FEATURE_RENDERDOC
|
||||||
if (sess->sys->inst->rdoc_api) {
|
if (sess->sys->inst->rdoc_api) {
|
||||||
|
#ifndef XR_USE_PLATFORM_ANDROID
|
||||||
sess->sys->inst->rdoc_api->EndFrameCapture(NULL, NULL);
|
sess->sys->inst->rdoc_api->EndFrameCapture(NULL, NULL);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ oxr_session_populate_egl(struct oxr_logger *log,
|
||||||
struct oxr_session *sess)
|
struct oxr_session *sess)
|
||||||
{
|
{
|
||||||
EGLint egl_client_type = -1;
|
EGLint egl_client_type = -1;
|
||||||
|
bool renderdoc_enabled = false;
|
||||||
|
|
||||||
PFNEGLQUERYCONTEXTPROC eglQueryContext = (PFNEGLQUERYCONTEXTPROC)next->getProcAddress("eglQueryContext");
|
PFNEGLQUERYCONTEXTPROC eglQueryContext = (PFNEGLQUERYCONTEXTPROC)next->getProcAddress("eglQueryContext");
|
||||||
if (!eglQueryContext) {
|
if (!eglQueryContext) {
|
||||||
|
@ -67,7 +68,7 @@ oxr_session_populate_egl(struct oxr_logger *log,
|
||||||
next->config, //
|
next->config, //
|
||||||
next->context, //
|
next->context, //
|
||||||
next->getProcAddress, //
|
next->getProcAddress, //
|
||||||
false, // renderdoc_enabled
|
renderdoc_enabled, // renderdoc_enabled
|
||||||
&xcgl); //
|
&xcgl); //
|
||||||
|
|
||||||
if (xret == XRT_ERROR_EGL_CONFIG_MISSING) {
|
if (xret == XRT_ERROR_EGL_CONFIG_MISSING) {
|
||||||
|
|
|
@ -76,6 +76,13 @@ oxr_session_populate_gles_android(struct oxr_logger *log,
|
||||||
return oxr_error(log, XR_ERROR_INITIALIZATION_FAILED, "Unsupported EGL client type");
|
return oxr_error(log, XR_ERROR_INITIALIZATION_FAILED, "Unsupported EGL client type");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool renderdoc_enabled = false;
|
||||||
|
|
||||||
|
#if defined(XRT_FEATURE_RENDERDOC)
|
||||||
|
if (sess->sys->inst->rdoc_api) {
|
||||||
|
renderdoc_enabled = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct xrt_compositor_native *xcn = sess->xcn;
|
struct xrt_compositor_native *xcn = sess->xcn;
|
||||||
struct xrt_compositor_gl *xcgl = NULL;
|
struct xrt_compositor_gl *xcgl = NULL;
|
||||||
|
@ -85,6 +92,7 @@ oxr_session_populate_gles_android(struct oxr_logger *log,
|
||||||
next->config, //
|
next->config, //
|
||||||
next->context, //
|
next->context, //
|
||||||
get_proc_addr, //
|
get_proc_addr, //
|
||||||
|
renderdoc_enabled, //
|
||||||
&xcgl); //
|
&xcgl); //
|
||||||
|
|
||||||
if (xret == XRT_ERROR_EGL_CONFIG_MISSING) {
|
if (xret == XRT_ERROR_EGL_CONFIG_MISSING) {
|
||||||
|
|
|
@ -81,6 +81,7 @@ oxr_session_populate_vk(struct oxr_logger *log,
|
||||||
bool timeline_semaphore_enabled = sess->sys->vk.timeline_semaphore_enabled;
|
bool timeline_semaphore_enabled = sess->sys->vk.timeline_semaphore_enabled;
|
||||||
bool external_fence_fd_enabled = sess->sys->vk.external_fence_fd_enabled;
|
bool external_fence_fd_enabled = sess->sys->vk.external_fence_fd_enabled;
|
||||||
bool external_semaphore_fd_enabled = sess->sys->vk.external_semaphore_fd_enabled;
|
bool external_semaphore_fd_enabled = sess->sys->vk.external_semaphore_fd_enabled;
|
||||||
|
bool renderdoc_enabled = false;
|
||||||
|
|
||||||
|
|
||||||
#if defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_FD)
|
#if defined(XRT_GRAPHICS_BUFFER_HANDLE_IS_FD)
|
||||||
|
@ -109,6 +110,12 @@ oxr_session_populate_vk(struct oxr_logger *log,
|
||||||
timeline_semaphore_enabled = true;
|
timeline_semaphore_enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(XRT_FEATURE_RENDERDOC) && defined(XR_USE_PLATFORM_ANDROID)
|
||||||
|
if (sess->sys->inst->rdoc_api) {
|
||||||
|
renderdoc_enabled = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
struct xrt_compositor_native *xcn = sess->xcn;
|
struct xrt_compositor_native *xcn = sess->xcn;
|
||||||
struct xrt_compositor_vk *xcvk = xrt_gfx_vk_provider_create( //
|
struct xrt_compositor_vk *xcvk = xrt_gfx_vk_provider_create( //
|
||||||
xcn, //
|
xcn, //
|
||||||
|
@ -120,7 +127,7 @@ oxr_session_populate_vk(struct oxr_logger *log,
|
||||||
external_semaphore_fd_enabled, //
|
external_semaphore_fd_enabled, //
|
||||||
timeline_semaphore_enabled, //
|
timeline_semaphore_enabled, //
|
||||||
sess->sys->vk.debug_utils_enabled, //
|
sess->sys->vk.debug_utils_enabled, //
|
||||||
false, //
|
renderdoc_enabled, //
|
||||||
next->queueFamilyIndex, //
|
next->queueFamilyIndex, //
|
||||||
next->queueIndex); //
|
next->queueIndex); //
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue