mirror of https://github.com/bjornbytes/lovr.git
fixup: gracefully handle XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB and return |false| instead.
This commit is contained in:
parent
425a2ca343
commit
02c67d090d
|
@ -1036,10 +1036,19 @@ static float* openxr_getDisplayFrequencies(uint32_t* count) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool openxr_setDisplayFrequency(float frequency) {
|
static bool openxr_setDisplayFrequency(float frequency) {
|
||||||
if (!state.features.refreshRate) return false;
|
if (!state.features.refreshRate) {
|
||||||
XR(xrRequestDisplayRefreshRateFB(state.session, frequency));
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
XrResult res = xrRequestDisplayRefreshRateFB(state.session, frequency);
|
||||||
|
if (res == XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
XR(res);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static double openxr_getDisplayTime(void) {
|
static double openxr_getDisplayTime(void) {
|
||||||
return state.frameState.predictedDisplayTime / 1e9;
|
return state.frameState.predictedDisplayTime / 1e9;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue