openxr: fix xrLocateViews call;

- The input parameter is a count, not a size
- The view structs must be initialized with a type
This commit is contained in:
bjorn 2021-10-24 13:03:05 -07:00
parent 8e64ded60a
commit e1527a949a
1 changed files with 6 additions and 1 deletions

View File

@ -607,8 +607,13 @@ static void getViews(XrView views[2], uint32_t* count) {
.space = state.referenceSpace
};
for (uint32_t i = 0; i < 2; i++) {
views[i].type = XR_TYPE_VIEW;
views[i].next = NULL;
}
XrViewState viewState = { .type = XR_TYPE_VIEW_STATE };
XR(xrLocateViews(state.session, &viewLocateInfo, &viewState, 2 * sizeof(XrView), count, views));
XR(xrLocateViews(state.session, &viewLocateInfo, &viewState, 2, count, views));
}
static uint32_t openxr_getViewCount(void) {