1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-20 14:45:44 +00:00

OpenXR: Add OpenXRAPIExtension::update_main_swapchain_size()

This commit is contained in:
dhoverb
2025-11-06 13:19:53 -06:00
committed by David Hover
parent 68410acc61
commit 8adea5454e
5 changed files with 45 additions and 0 deletions

View File

@@ -2228,6 +2228,27 @@ void OpenXRAPI::_set_render_state_render_region_rt(const Rect2i &p_render_region
openxr_api->render_state.render_region = p_render_region;
}
void OpenXRAPI::_update_main_swapchain_size_rt() {
ERR_NOT_ON_RENDER_THREAD;
OpenXRAPI *openxr_api = OpenXRAPI::get_singleton();
ERR_FAIL_NULL(openxr_api);
uint32_t view_count_output = 0;
XrResult result = openxr_api->xrEnumerateViewConfigurationViews(openxr_api->instance, openxr_api->system_id, openxr_api->view_configuration, openxr_api->get_view_count(), &view_count_output, openxr_api->view_configuration_views.ptr());
if (XR_FAILED(result)) {
return;
}
#ifdef DEBUG_ENABLED
for (uint32_t i = 0; i < view_count_output; i++) {
print_verbose("OpenXR: Recommended resolution changed");
print_verbose(String(" - recommended render width: ") + itos(openxr_api->view_configuration_views[i].recommendedImageRectWidth));
print_verbose(String(" - recommended render height: ") + itos(openxr_api->view_configuration_views[i].recommendedImageRectHeight));
}
#endif
}
bool OpenXRAPI::process() {
ERR_FAIL_COND_V(instance == XR_NULL_HANDLE, false);