Allow using custom Rect2i for rendering with OpenXR

This commit is contained in:
devloglogan 2024-09-20 15:57:19 -05:00
parent 4364ed6ccd
commit e7f6b7ea0b
25 changed files with 215 additions and 19 deletions

View file

@ -1055,6 +1055,14 @@ Projection OpenXRInterface::get_projection_for_view(uint32_t p_view, double p_as
return cm;
}
Rect2i OpenXRInterface::get_render_region() {
if (openxr_api) {
return openxr_api->get_render_region();
} else {
return Rect2i();
}
}
RID OpenXRInterface::get_color_texture() {
if (openxr_api) {
return openxr_api->get_color_texture();
@ -1528,6 +1536,8 @@ RID OpenXRInterface::get_vrs_texture() {
eye_foci.push_back(openxr_api->get_eye_focus(v, aspect_ratio));
}
xr_vrs.set_vrs_render_region(get_render_region());
return xr_vrs.make_vrs_texture(target_size, eye_foci);
}