[Bf-blender-cvs] [34430ac5f51] vamr-openxr-module: Remove Ghost-XR code

Julian Eisel noreply at git.blender.org
Sat Aug 31 13:11:33 CEST 2019


Commit: 34430ac5f51980fd6cdb93ac7f29b68b67f91871
Author: Julian Eisel
Date:   Sat Aug 31 13:06:50 2019 +0200
Branches: vamr-openxr-module
https://developer.blender.org/rB34430ac5f51980fd6cdb93ac7f29b68b67f91871

Remove Ghost-XR code

Also fixes remaining call to it.

===================================================================

M	intern/ghost/CMakeLists.txt
M	intern/ghost/GHOST_C-api.h
D	intern/ghost/GHOST_IXrContext.h
M	intern/ghost/GHOST_Types.h
M	intern/ghost/intern/GHOST_C-api.cpp
D	intern/ghost/intern/GHOST_IXrGraphicsBinding.h
D	intern/ghost/intern/GHOST_Xr.cpp
D	intern/ghost/intern/GHOST_XrContext.cpp
D	intern/ghost/intern/GHOST_XrContext.h
D	intern/ghost/intern/GHOST_XrEvent.cpp
D	intern/ghost/intern/GHOST_XrException.h
D	intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
D	intern/ghost/intern/GHOST_XrSession.cpp
D	intern/ghost/intern/GHOST_XrSession.h
D	intern/ghost/intern/GHOST_Xr_intern.h
D	intern/ghost/intern/GHOST_Xr_openxr_includes.h
M	source/blender/windowmanager/intern/wm_window.c

===================================================================

diff --git a/intern/ghost/CMakeLists.txt b/intern/ghost/CMakeLists.txt
index 5f7d9232782..d7b1a396303 100644
--- a/intern/ghost/CMakeLists.txt
+++ b/intern/ghost/CMakeLists.txt
@@ -347,35 +347,6 @@ elseif(WIN32)
 
 endif()
 
-if(WITH_OPENXR)
-  list(APPEND SRC
-    intern/GHOST_Xr.cpp
-    intern/GHOST_XrContext.cpp
-    intern/GHOST_XrEvent.cpp
-    intern/GHOST_XrGraphicsBinding.cpp
-    intern/GHOST_XrSession.cpp
-
-    GHOST_IXrContext.h
-    intern/GHOST_Xr_intern.h
-    intern/GHOST_Xr_openxr_includes.h
-    intern/GHOST_XrContext.h
-    intern/GHOST_IXrGraphicsBinding.h
-    intern/GHOST_XrSession.h
-  )
-  list(APPEND INC_SYS
-    ${OPENXR_SDK_INCLUDE_DIR}
-  )
-  if(WIN32)
-    list(APPEND LIB
-      shlwapi
-    )
-  endif()
-
-  include(xr_platform_defines)
-
-  add_definitions(-DWITH_OPENXR)
-endif()
-
 add_definitions(${GL_DEFINITIONS})
 
 blender_add_lib(bf_intern_ghost "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 1f3b013fba9..66b833a2d69 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -960,36 +960,6 @@ extern void GHOST_BeginIME(GHOST_WindowHandle windowhandle,
  */
 extern void GHOST_EndIME(GHOST_WindowHandle windowhandle);
 
-#ifdef WITH_OPENXR
-
-/* xr-context */
-
-/**
- * Set a custom callback to be executed whenever an error occurs. Should be set before calling
- * #GHOST_XrContextCreate().
- */
-void GHOST_XrErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata);
-
-GHOST_XrContextHandle GHOST_XrContextCreate(const GHOST_XrContextCreateInfo *create_info);
-void GHOST_XrContextDestroy(GHOST_XrContextHandle xr_context);
-
-void GHOST_XrGraphicsContextBindFuncs(GHOST_XrContextHandle xr_context,
-                                      GHOST_XrGraphicsContextBindFn bind_fn,
-                                      GHOST_XrGraphicsContextUnbindFn unbind_fn);
-
-void GHOST_XrDrawViewFunc(GHOST_XrContextHandle xr_context, GHOST_XrDrawViewFn draw_view_fn);
-
-/* sessions */
-int GHOST_XrSessionIsRunning(const GHOST_XrContextHandle xr_context);
-void GHOST_XrSessionStart(GHOST_XrContextHandle xr_context,
-                          const GHOST_XrSessionBeginInfo *begin_info);
-void GHOST_XrSessionEnd(GHOST_XrContextHandle xr_context);
-void GHOST_XrSessionDrawViews(GHOST_XrContextHandle xr_context, void *customdata);
-
-/* events */
-GHOST_TSuccess GHOST_XrEventsHandle(GHOST_XrContextHandle xr_context);
-#endif
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/intern/ghost/GHOST_IXrContext.h b/intern/ghost/GHOST_IXrContext.h
deleted file mode 100644
index 362bc923ee8..00000000000
--- a/intern/ghost/GHOST_IXrContext.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-/** \file
- * \ingroup GHOST
- */
-
-#ifndef __GHOST_IXRCONTEXT_H__
-#define __GHOST_IXRCONTEXT_H__
-
-#include "GHOST_Types.h"
-
-class GHOST_IXrContext {
- public:
-  virtual ~GHOST_IXrContext() = default;
-
-  virtual void startSession(const GHOST_XrSessionBeginInfo *begin_info) = 0;
-  virtual void endSession() = 0;
-  virtual bool isSessionRunning() const = 0;
-  virtual void drawSessionViews(void *draw_customdata) = 0;
-
-  virtual void dispatchErrorMessage(const class GHOST_XrException *) const = 0;
-
-  virtual void setGraphicsContextBindFuncs(GHOST_XrGraphicsContextBindFn bind_fn,
-                                           GHOST_XrGraphicsContextUnbindFn unbind_fn) = 0;
-  virtual void setDrawViewFunc(GHOST_XrDrawViewFn draw_view_fn) = 0;
-};
-
-#endif  // __GHOST_IXRCONTEXT_H__
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h
index 9d2af3216ed..df079941ea7 100644
--- a/intern/ghost/GHOST_Types.h
+++ b/intern/ghost/GHOST_Types.h
@@ -561,81 +561,4 @@ struct GHOST_TimerTaskHandle__;
 typedef void (*GHOST_TimerProcPtr)(struct GHOST_TimerTaskHandle__ *task, GHOST_TUns64 time);
 #endif
 
-#ifdef WITH_OPENXR
-
-/**
- * The XR view (i.e. the OpenXR runtime) may require a different graphics library than OpenGL. An
- * offscreen texture of the viewport will then be drawn into using OpenGL, but the final texture
- * draw call will happen through another lib (say DirectX).
- *
- * This enum defines the possible graphics bindings to attempt to enable.
- */
-typedef enum {
-  GHOST_kXrGraphicsUnknown = 0,
-  GHOST_kXrGraphicsOpenGL,
-#  ifdef WIN32
-  GHOST_kXrGraphicsD3D11,
-#  endif
-  /* For later */
-  //  GHOST_kXrGraphicsVulkan,
-} GHOST_TXrGraphicsBinding;
-/* An array of GHOST_TXrGraphicsBinding items defining the candidate bindings to use. The first
- * available candidate will be chosen, so order defines priority. */
-typedef const GHOST_TXrGraphicsBinding *GHOST_XrGraphicsBindingCandidates;
-
-typedef struct {
-  float position[3];
-  /* Blender convention (w, x, y, z) */
-  float orientation_quat[4];
-} GHOST_XrPose;
-
-enum {
-  GHOST_kXrContextDebug = (1 << 0),
-  GHOST_kXrContextDebugTime = (1 << 1),
-};
-
-typedef struct {
-  const GHOST_XrGraphicsBindingCandidates gpu_binding_candidates;
-  unsigned int gpu_binding_candidates_count;
-
-  unsigned int context_flag;
-} GHOST_XrContextCreateInfo;
-
-typedef struct {
-  GHOST_XrPose base_pose;
-} GHOST_XrSessionBeginInfo;
-
-typedef struct {
-  int ofsx, ofsy;
-  int width, height;
-
-  GHOST_XrPose pose;
-
-  struct {
-    float angle_left, angle_right;
-    float angle_up, angle_down;
-  } fov;
-
-  /** Set if the buffer should be submitted with a srgb transfer applied. */
-  char expects_srgb_buffer;
-} GHOST_XrDrawViewInfo;
-
-typedef struct {
-  const char *user_message;
-
-  /** File path and line number the error was found at. */
-  const char *source_location;
-
-  void *customdata;
-} GHOST_XrError;
-
-typedef void (*GHOST_XrErrorHandlerFn)(const GHOST_XrError *);
-
-typedef void *(*GHOST_XrGraphicsContextBindFn)(GHOST_TXrGraphicsBinding graphics_lib);
-typedef void (*GHOST_XrGraphicsContextUnbindFn)(GHOST_TXrGraphicsBinding graphics_lib,
-                                                void *graphics_context);
-typedef void (*GHOST_XrDrawViewFn)(const GHOST_XrDrawViewInfo *draw_view, void *customdata);
-
-#endif
-
 #endif  // __GHOST_TYPES_H__
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index d0f068f5e3c..69d18cac7a6 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -30,11 +30,7 @@
 #include "GHOST_ISystem.h"
 #include "GHOST_IEvent.h"
 #include "GHOST_IEventConsumer.h"
-#ifdef WITH_OPENXR
-#  include "GHOST_IXrContext.h"
-#endif
 #include "intern/GHOST_CallbackEventConsumer.h"
-#include "intern/GHOST_XrException.h"
 
 GHOST_SystemHandle GHOST_CreateSystem(void)
 {
@@ -874,63 +870,3 @@ void GHOST_EndIME(GHOST_WindowHandle windowhandle)
 }
 
 #endif /* WITH_INPUT_IME */
-
-#ifdef WITH_OPENXR
-
-#  define GHOST_XR_CAPI_CALL(call, ctx) \
-    try { \
-      call; \
-    } \
-    catch (GHOST_XrException & e) { \
-      (ctx)->dispatchErrorMessage(&e); \
-    }
-
-#  define GHOST_XR_CAPI_CALL_RET(call, ctx) \
-    try { \
-      return call; \
-    } \
-    catch (GHOST_XrException & e) { \
-      (ctx)->dispatchErrorMessage(&e); \
-    }
-
-void GHOST_XrSessionStart(GHOST_XrContextHandle xr_contexthandle,
-                          const GHOST_XrSessionBeginInfo *begin_info)
-{
-  GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL(xr_context->startSession(begin_info), xr_context);
-}
-
-void GHOST_XrSessionEnd(GHOST_XrContextHandle xr_contexthandle)
-{
-  GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL(xr_context->endSession(), xr_context);
-}
-
-int GHOST_XrSessionIsRunning(const GHOST_XrContextHandle xr_contexthandle)
-{
-  const GHOST_IXrContext *xr_context = (const GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL_RET(xr_context->isSessionRunning(), xr_context);
-  return 0;  // Only reached if exception is thrown.
-}
-
-void GHOST_XrSessionDrawViews(GHOST_XrContextHandle xr_contexthandle, void *draw_customdata)
-{
-  GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL(xr_context->drawSessionViews(draw_customdata), xr_context);
-}
-
-void GHOST_XrGraphicsContextBindFuncs(GHOST_XrContextHandle xr_contexthandle,
-                                      GHOST_XrGraphicsContextBindFn bind_fn,
-                                      GHOST_XrGraphicsContextUnbindFn unbind_fn)
-{
-  GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL(xr_context->setGraphicsContextBindFuncs(bind_fn, unbind_fn), xr_context);
-}
-
-void GHOST_XrDrawViewFunc(GHOST_XrContextHandle xr_contexthandle, GHOST_XrDrawViewFn draw_view_fn)
-{
-  GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
-  GHOST_XR_CAPI_CALL(xr_context->setDrawViewFunc(draw_view_fn), xr_context);
-}
-
-#endif
diff --git a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
deleted file mode 100644
index 93eca1aa243..00000000000
--- a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY o

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list