mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-17 19:20:13 +00:00
st/oxr: Add layer type conditionals around depth-image manipulation
This commit is contained in:
parent
2ac0013e25
commit
ff603d3acd
|
@ -8,6 +8,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xrt/xrt_device.h"
|
#include "xrt/xrt_device.h"
|
||||||
|
#include "xrt/xrt_config_build.h"
|
||||||
|
#include "xrt/xrt_config_have.h"
|
||||||
|
|
||||||
#ifdef XR_USE_PLATFORM_XLIB
|
#ifdef XR_USE_PLATFORM_XLIB
|
||||||
#include "xrt/xrt_gfx_xlib.h"
|
#include "xrt/xrt_gfx_xlib.h"
|
||||||
|
@ -928,6 +930,7 @@ verify_projection_layer(struct xrt_compositor *xc,
|
||||||
sc->height);
|
sc->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
const XrCompositionLayerDepthInfoKHR *depth_info =
|
const XrCompositionLayerDepthInfoKHR *depth_info =
|
||||||
OXR_GET_INPUT_FROM_CHAIN(
|
OXR_GET_INPUT_FROM_CHAIN(
|
||||||
view, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
view, XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
||||||
|
@ -941,8 +944,10 @@ verify_projection_layer(struct xrt_compositor *xc,
|
||||||
}
|
}
|
||||||
num_depth_layers++;
|
num_depth_layers++;
|
||||||
}
|
}
|
||||||
|
#endif // XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
if (num_depth_layers > 0 && num_depth_layers != proj->viewCount) {
|
if (num_depth_layers > 0 && num_depth_layers != proj->viewCount) {
|
||||||
return oxr_error(
|
return oxr_error(
|
||||||
log, XR_ERROR_VALIDATION_FAILURE,
|
log, XR_ERROR_VALIDATION_FAILURE,
|
||||||
|
@ -950,6 +955,7 @@ verify_projection_layer(struct xrt_compositor *xc,
|
||||||
"depth layers or none, but has: %u)",
|
"depth layers or none, but has: %u)",
|
||||||
layer_index, proj->viewCount, num_depth_layers);
|
layer_index, proj->viewCount, num_depth_layers);
|
||||||
}
|
}
|
||||||
|
#endif // XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
|
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -1469,6 +1475,7 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
const XrCompositionLayerDepthInfoKHR *d_l = OXR_GET_INPUT_FROM_CHAIN(
|
const XrCompositionLayerDepthInfoKHR *d_l = OXR_GET_INPUT_FROM_CHAIN(
|
||||||
&proj->views[0], XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
&proj->views[0], XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
||||||
XrCompositionLayerDepthInfoKHR);
|
XrCompositionLayerDepthInfoKHR);
|
||||||
|
@ -1515,8 +1522,10 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
// Need to pass this in.
|
// Need to pass this in.
|
||||||
d_scs[1] = sc;
|
d_scs[1] = sc;
|
||||||
}
|
}
|
||||||
|
#endif // XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
|
|
||||||
if (d_scs[0] != NULL && d_scs[1] != NULL) {
|
if (d_scs[0] != NULL && d_scs[1] != NULL) {
|
||||||
|
#ifdef XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
data.type = XRT_LAYER_STEREO_PROJECTION_DEPTH;
|
data.type = XRT_LAYER_STEREO_PROJECTION_DEPTH;
|
||||||
CALL_CHK(xrt_comp_layer_stereo_projection_depth(
|
CALL_CHK(xrt_comp_layer_stereo_projection_depth(
|
||||||
xc, head,
|
xc, head,
|
||||||
|
@ -1525,6 +1534,9 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
d_scs[0]->swapchain, // Left
|
d_scs[0]->swapchain, // Left
|
||||||
d_scs[1]->swapchain, // Right
|
d_scs[1]->swapchain, // Right
|
||||||
&data));
|
&data));
|
||||||
|
#else
|
||||||
|
assert(false && "Should not get here");
|
||||||
|
#endif // XRT_FEATURE_OPENXR_LAYER_DEPTH
|
||||||
} else {
|
} else {
|
||||||
CALL_CHK(
|
CALL_CHK(
|
||||||
xrt_comp_layer_stereo_projection(xc, head,
|
xrt_comp_layer_stereo_projection(xc, head,
|
||||||
|
|
Loading…
Reference in a new issue