mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
OpenXR: Use the XR_FB_foveation_vulkan
extension to get the density map for VRS
This commit is contained in:
parent
b13c96b097
commit
79f5a4d9fe
24 changed files with 178 additions and 18 deletions
|
@ -267,6 +267,16 @@ RID OpenXRAPI::OpenXRSwapChainInfo::get_image() {
|
|||
}
|
||||
}
|
||||
|
||||
RID OpenXRAPI::OpenXRSwapChainInfo::get_density_map() {
|
||||
OpenXRAPI *openxr_api = OpenXRAPI::get_singleton();
|
||||
|
||||
if (image_acquired && openxr_api && openxr_api->get_graphics_extension()) {
|
||||
return openxr_api->get_graphics_extension()->get_density_map(swapchain_graphics_data, image_index);
|
||||
} else {
|
||||
return RID();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////
|
||||
// OpenXRAPI
|
||||
|
||||
|
@ -2370,6 +2380,17 @@ RID OpenXRAPI::get_depth_texture() {
|
|||
}
|
||||
}
|
||||
|
||||
RID OpenXRAPI::get_density_map_texture() {
|
||||
ERR_NOT_ON_RENDER_THREAD_V(RID());
|
||||
|
||||
OpenXRFBFoveationExtension *fov_ext = OpenXRFBFoveationExtension::get_singleton();
|
||||
if (fov_ext && fov_ext->is_enabled()) {
|
||||
return render_state.main_swapchains[OPENXR_SWAPCHAIN_COLOR].get_density_map();
|
||||
}
|
||||
|
||||
return RID();
|
||||
}
|
||||
|
||||
void OpenXRAPI::set_velocity_texture(RID p_render_target) {
|
||||
velocity_texture = p_render_target;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue