mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-02-17 19:20:13 +00:00
st/oxr: Use the right depth projection function
This commit is contained in:
parent
cd6a237b4a
commit
bf9f0e6e39
|
@ -1408,6 +1408,7 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
{
|
{
|
||||||
struct oxr_space *spc =
|
struct oxr_space *spc =
|
||||||
XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_space *, proj->space);
|
XRT_CAST_OXR_HANDLE_TO_PTR(struct oxr_space *, proj->space);
|
||||||
|
struct oxr_swapchain *d_scs[2] = {NULL, NULL};
|
||||||
struct oxr_swapchain *scs[2];
|
struct oxr_swapchain *scs[2];
|
||||||
struct xrt_pose *pose_ptr[2];
|
struct xrt_pose *pose_ptr[2];
|
||||||
struct xrt_pose pose[2];
|
struct xrt_pose pose[2];
|
||||||
|
@ -1472,8 +1473,6 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
&proj->views[0], XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
&proj->views[0], XR_TYPE_COMPOSITION_LAYER_DEPTH_INFO_KHR,
|
||||||
XrCompositionLayerDepthInfoKHR);
|
XrCompositionLayerDepthInfoKHR);
|
||||||
if (d_l) {
|
if (d_l) {
|
||||||
data.type = XRT_LAYER_STEREO_PROJECTION_DEPTH;
|
|
||||||
|
|
||||||
data.stereo_depth.l_d.far_z = d_l->farZ;
|
data.stereo_depth.l_d.far_z = d_l->farZ;
|
||||||
data.stereo_depth.l_d.near_z = d_l->nearZ;
|
data.stereo_depth.l_d.near_z = d_l->nearZ;
|
||||||
data.stereo_depth.l_d.max_depth = d_l->maxDepth;
|
data.stereo_depth.l_d.max_depth = d_l->maxDepth;
|
||||||
|
@ -1488,6 +1487,9 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
data.stereo_depth.l_d.sub.array_index =
|
data.stereo_depth.l_d.sub.array_index =
|
||||||
d_l->subImage.imageArrayIndex;
|
d_l->subImage.imageArrayIndex;
|
||||||
data.stereo_depth.l_d.sub.rect = *d_l_rect;
|
data.stereo_depth.l_d.sub.rect = *d_l_rect;
|
||||||
|
|
||||||
|
// Need to pass this in.
|
||||||
|
d_scs[0] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
const XrCompositionLayerDepthInfoKHR *d_r = OXR_GET_INPUT_FROM_CHAIN(
|
const XrCompositionLayerDepthInfoKHR *d_r = OXR_GET_INPUT_FROM_CHAIN(
|
||||||
|
@ -1495,8 +1497,6 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
XrCompositionLayerDepthInfoKHR);
|
XrCompositionLayerDepthInfoKHR);
|
||||||
|
|
||||||
if (d_r) {
|
if (d_r) {
|
||||||
data.type = XRT_LAYER_STEREO_PROJECTION_DEPTH;
|
|
||||||
|
|
||||||
data.stereo_depth.r_d.far_z = d_r->farZ;
|
data.stereo_depth.r_d.far_z = d_r->farZ;
|
||||||
data.stereo_depth.r_d.near_z = d_r->nearZ;
|
data.stereo_depth.r_d.near_z = d_r->nearZ;
|
||||||
data.stereo_depth.r_d.max_depth = d_r->maxDepth;
|
data.stereo_depth.r_d.max_depth = d_r->maxDepth;
|
||||||
|
@ -1511,13 +1511,28 @@ submit_projection_layer(struct xrt_compositor *xc,
|
||||||
data.stereo_depth.r_d.sub.array_index =
|
data.stereo_depth.r_d.sub.array_index =
|
||||||
d_r->subImage.imageArrayIndex;
|
d_r->subImage.imageArrayIndex;
|
||||||
data.stereo_depth.r_d.sub.rect = *d_l_rect;
|
data.stereo_depth.r_d.sub.rect = *d_l_rect;
|
||||||
|
|
||||||
|
// Need to pass this in.
|
||||||
|
d_scs[1] = sc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (d_scs[0] != NULL && d_scs[1] != NULL) {
|
||||||
|
data.type = XRT_LAYER_STEREO_PROJECTION_DEPTH;
|
||||||
|
CALL_CHK(xrt_comp_layer_stereo_projection_depth(
|
||||||
|
xc, head,
|
||||||
|
scs[0]->swapchain, // Left
|
||||||
|
scs[1]->swapchain, // Right
|
||||||
|
d_scs[0]->swapchain, // Left
|
||||||
|
d_scs[1]->swapchain, // Right
|
||||||
|
&data));
|
||||||
|
} else {
|
||||||
|
CALL_CHK(
|
||||||
|
xrt_comp_layer_stereo_projection(xc, head,
|
||||||
|
scs[0]->swapchain, // Left
|
||||||
|
scs[1]->swapchain, // Right
|
||||||
|
&data));
|
||||||
|
}
|
||||||
|
|
||||||
CALL_CHK(xrt_comp_layer_stereo_projection(xc, head,
|
|
||||||
scs[0]->swapchain, // Left
|
|
||||||
scs[1]->swapchain, // Right
|
|
||||||
&data));
|
|
||||||
return XR_SUCCESS;
|
return XR_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue