64 if (
wm->xr.runtime &&
wm->xr.runtime->ghost_context) {
70 error_customdata.
wm =
wm;
76#ifdef WITH_OPENGL_BACKEND
78 gpu_bindings_candidates.
append(GHOST_kXrGraphicsOpenGL);
80 gpu_bindings_candidates.
append(GHOST_kXrGraphicsOpenGLD3D11);
85#ifdef WITH_VULKAN_BACKEND
87 gpu_bindings_candidates.
append(GHOST_kXrGraphicsVulkan);
89 gpu_bindings_candidates.
append(GHOST_kXrGraphicsVulkanD3D11);
94#ifdef WITH_METAL_BACKEND
96 gpu_bindings_candidates.
append(GHOST_kXrGraphicsMetal);
104 GHOST_XrContextCreateInfo create_info{
105 gpu_bindings_candidates.
data(),
109 create_info.context_flag |= GHOST_kXrContextDebug;
112 create_info.context_flag |= GHOST_kXrContextDebugTime;
116 create_info.context_flag |= GHOST_kXrContextGpuNVIDIA;
133 if (!
wm->xr.runtime) {
135 wm->xr.runtime->ghost_context = ghost_context;
149 BLI_assert(
wm->xr.runtime &&
wm->xr.runtime->ghost_context &&
wm->xr.runtime->b_context);
156 if (
wm->xr.runtime !=
nullptr) {
166 if (
wm->xr.runtime &&
wm->xr.runtime->ghost_context) {
198 if ((*runtime)->ghost_context !=
nullptr) {
201 (*runtime)->ghost_context =
nullptr;
207 if (*runtime !=
nullptr) {
208 ScrArea *xr_offscreen_area = (*runtime)->offscreen_area;
221 MEM_SAFE_DELETE(*runtime);
Abstraction for XR (VR, AR, MR, ..) access via OpenXR.
void GHOST_XrContextDestroy(GHOST_IXrContext *xr_context)
void GHOST_XrPassthroughEnabledFunc(GHOST_IXrContext *xr_context, GHOST_XrPassthroughEnabledFn passthrough_enabled_fn)
GHOST_IXrContext * GHOST_XrContextCreate(const GHOST_XrContextCreateInfo *create_info)
Initialize the Ghost XR-context.
GHOST_TSuccess GHOST_XrEventsHandle(GHOST_IXrContext *xr_context)
void GHOST_XrDisablePassthroughFunc(GHOST_IXrContext *xr_context, GHOST_XrDisablePassthroughFn disable_passthrough_fn)
void GHOST_XrErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
void GHOST_XrGraphicsContextBindFuncs(GHOST_IXrContext *xr_context, GHOST_XrGraphicsContextBindFn bind_fn, GHOST_XrGraphicsContextUnbindFn unbind_fn)
void GHOST_XrDrawViewFunc(GHOST_IXrContext *xr_context, GHOST_XrDrawViewFn draw_view_fn)
Read Blender memory allocation and freeing.
void append(const T &value)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
bool wm_xr_passthrough_enabled(void *customdata)
Check if XR passthrough is enabled.
void WM_report_banner_show(wmWindowManager *wm, wmWindow *win)
static void wm_xr_error_handler(const GHOST_XrError *error)
wmWindow * wm_xr_session_root_window_or_fallback_get(const wmWindowManager *wm, const wmXrRuntimeData *runtime_data)
void wm_xr_draw_view(const GHOST_XrDrawViewInfo *draw_view, void *customdata)
Draw a viewport for a single eye.
void wm_xr_session_actions_update(wmWindowManager *wm)
GPUBackendType GPU_backend_get_type()
GHOST_IContext * wm_xr_session_gpu_binding_context_create()
wmWindow * CTX_wm_window(const bContext *C)
void BKE_reports_clear(ReportList *reports)
bool wm_xr_init(bContext *C)
bool GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void wm_xr_session_gpu_binding_context_destroy(GHOST_IContext *context)
wmWindowManager * CTX_wm_manager(const bContext *C)
void ED_area_offscreen_free(wmWindowManager *wm, wmWindow *win, ScrArea *area)
void CTX_free(bContext *C)
bContext * WM_xr_session_context_ensure(wmXrData *xr, const wmWindowManager *wm)
bool WM_xr_session_is_ready(const wmXrData *xr)
void WM_global_report(eReportType type, const char *message)
ScrArea * ED_area_offscreen_create(wmWindow *win, eSpace_Type space_type)
Main * CTX_data_main(const bContext *C)
void wm_xr_exit(wmWindowManager *wm)
void wm_xr_runtime_data_free(wmXrRuntimeData **runtime)
void CTX_wm_manager_set(bContext *C, wmWindowManager *wm)
void WM_event_remove_handlers_by_area(ListBaseT< wmEventHandler > *handlers, const ScrArea *area)
void CTX_data_main_set(bContext *C, Main *bmain)
void wm_xr_session_data_free(wmXrSessionState *state)
void wm_xr_disable_passthrough(void *customdata)
Disable XR passthrough if not supported.
bool wm_xr_events_handle(wmWindowManager *wm)
wmXrRuntimeData * wm_xr_runtime_data_create()
void WM_xr_actionmaps_clear(wmXrRuntimeData *runtime)
ListBaseT< wmEventHandler > handlers
bke::WindowRuntime * runtime