mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
st/oxr: Verify that projection layer has 0 or view count depth layers
This commit is contained in:
parent
ac6edb94c2
commit
2cd010b65f
|
@ -839,6 +839,9 @@ verify_projection_layer(struct xrt_compositor *xc,
|
|||
layer_index, proj->viewCount);
|
||||
}
|
||||
|
||||
// number of depth layers must be 0 or proj->viewCount
|
||||
uint32_t num_depth_layers = 0;
|
||||
|
||||
// Check for valid swapchain states.
|
||||
for (uint32_t i = 0; i < proj->viewCount; i++) {
|
||||
const XrCompositionLayerProjectionView *view = &proj->views[i];
|
||||
|
@ -936,9 +939,18 @@ verify_projection_layer(struct xrt_compositor *xc,
|
|||
if (ret != XR_SUCCESS) {
|
||||
return ret;
|
||||
}
|
||||
num_depth_layers++;
|
||||
}
|
||||
}
|
||||
|
||||
if (num_depth_layers > 0 && num_depth_layers != proj->viewCount) {
|
||||
return oxr_error(
|
||||
log, XR_ERROR_VALIDATION_FAILURE,
|
||||
"(frameEndInfo->layers[%u] projection layer must have %u "
|
||||
"depth layers or none, but has: %u)",
|
||||
layer_index, proj->viewCount, num_depth_layers);
|
||||
}
|
||||
|
||||
return XR_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue