mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
OpenXR: Allow moving vendor passthrough extensions to GDExtension
This commit is contained in:
parent
9adb7c7d13
commit
e74a0f4b09
14 changed files with 155 additions and 497 deletions
|
@ -56,7 +56,6 @@
|
|||
#include "extensions/openxr_composition_layer_depth_extension.h"
|
||||
#include "extensions/openxr_fb_display_refresh_rate_extension.h"
|
||||
#include "extensions/openxr_fb_foveation_extension.h"
|
||||
#include "extensions/openxr_fb_passthrough_extension_wrapper.h"
|
||||
#include "extensions/openxr_fb_update_swapchain_extension.h"
|
||||
|
||||
#ifdef ANDROID_ENABLED
|
||||
|
@ -3099,11 +3098,30 @@ bool OpenXRAPI::is_environment_blend_mode_supported(XrEnvironmentBlendMode p_ble
|
|||
}
|
||||
|
||||
bool OpenXRAPI::set_environment_blend_mode(XrEnvironmentBlendMode p_blend_mode) {
|
||||
if (emulate_environment_blend_mode_alpha_blend && p_blend_mode == XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND) {
|
||||
requested_environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND;
|
||||
environment_blend_mode = XR_ENVIRONMENT_BLEND_MODE_OPAQUE;
|
||||
return true;
|
||||
}
|
||||
// We allow setting this when not initialized and will check if it is supported when initializing.
|
||||
// After OpenXR is initialized we verify we're setting a supported blend mode.
|
||||
if (!is_initialized() || is_environment_blend_mode_supported(p_blend_mode)) {
|
||||
else if (!is_initialized() || is_environment_blend_mode_supported(p_blend_mode)) {
|
||||
requested_environment_blend_mode = p_blend_mode;
|
||||
environment_blend_mode = p_blend_mode;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OpenXRAPI::set_emulate_environment_blend_mode_alpha_blend(bool p_enabled) {
|
||||
emulate_environment_blend_mode_alpha_blend = p_enabled;
|
||||
}
|
||||
|
||||
OpenXRAPI::OpenXRAlphaBlendModeSupport OpenXRAPI::is_environment_blend_mode_alpha_blend_supported() {
|
||||
if (is_environment_blend_mode_supported(XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND)) {
|
||||
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_REAL;
|
||||
} else if (emulate_environment_blend_mode_alpha_blend) {
|
||||
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_EMULATING;
|
||||
}
|
||||
return OPENXR_ALPHA_BLEND_MODE_SUPPORT_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue