[Bf-blender-cvs] [6152113b453] tmp-vulkan: Merge commit 'master@{6-weeks-ago}' into tmp-vulkan

Jeroen Bakker noreply at git.blender.org
Mon Jun 28 15:57:46 CEST 2021


Commit: 6152113b453a15afd0faae4a9c1762ad8362d65a
Author: Jeroen Bakker
Date:   Mon Jun 28 14:06:11 2021 +0200
Branches: tmp-vulkan
https://developer.blender.org/rB6152113b453a15afd0faae4a9c1762ad8362d65a

Merge commit 'master@{6-weeks-ago}' into tmp-vulkan

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



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

diff --cc intern/ghost/GHOST_C-api.h
index ee33d555b32,2bd9af6df5c..e50eddd3d2b
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@@ -1067,32 -1059,111 +1067,135 @@@ int GHOST_XrSessionNeedsUpsideDownDrawi
   * \returns GHOST_kSuccess if any event was handled, otherwise GHOST_kFailure.
   */
  GHOST_TSuccess GHOST_XrEventsHandle(GHOST_XrContextHandle xr_context);
- #endif
+ 
+ /* actions */
+ /**
+  * Create an OpenXR action set for input/output.
+  */
+ int GHOST_XrCreateActionSet(GHOST_XrContextHandle xr_context, const GHOST_XrActionSetInfo *info);
+ 
+ /**
+  * Destroy a previously created OpenXR action set.
+  */
+ void GHOST_XrDestroyActionSet(GHOST_XrContextHandle xr_context, const char *action_set_name);
+ 
+ /**
+  * Create OpenXR input/output actions.
+  */
+ int GHOST_XrCreateActions(GHOST_XrContextHandle xr_context,
+                           const char *action_set_name,
+                           GHOST_TUns32 count,
+                           const GHOST_XrActionInfo *infos);
+ 
+ /**
+  * Destroy previously created OpenXR actions.
+  */
+ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_context,
+                             const char *action_set_name,
+                             GHOST_TUns32 count,
+                             const char *const *action_names);
+ 
+ /**
+  * Create spaces for pose-based OpenXR actions.
+  */
+ int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_context,
+                                const char *action_set_name,
+                                GHOST_TUns32 count,
+                                const GHOST_XrActionSpaceInfo *infos);
+ 
+ /**
+  * Destroy previously created spaces for OpenXR actions.
+  */
+ void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_context,
+                                  const char *action_set_name,
+                                  GHOST_TUns32 count,
+                                  const GHOST_XrActionSpaceInfo *infos);
+ 
+ /**
+  * Create input/output path bindings for OpenXR actions.
+  */
+ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_context,
+                                  const char *action_set_name,
+                                  GHOST_TUns32 count,
+                                  const GHOST_XrActionProfileInfo *infos);
+ 
+ /**
+  * Destroy previously created bindings for OpenXR actions.
+  */
+ void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_context,
+                                    const char *action_set_name,
+                                    GHOST_TUns32 count,
+                                    const GHOST_XrActionProfileInfo *infos);
+ 
+ /**
+  * Attach all created action sets to the current OpenXR session.
+  */
+ int GHOST_XrAttachActionSets(GHOST_XrContextHandle xr_context);
+ 
+ /**
+  * Update button/tracking states for OpenXR actions.
+  *
+  * \param action_set_name: The name of the action set to sync. If NULL, all action sets
+  * attached to the session will be synced.
+  */
+ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_context, const char *action_set_name);
+ 
+ /**
+  * Apply an OpenXR haptic output action.
+  */
+ int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_context,
+                               const char *action_set_name,
+                               const char *action_name,
+                               const GHOST_TInt64 *duration,
+                               const float *frequency,
+                               const float *amplitude);
+ 
+ /**
+  * Stop a previously applied OpenXR haptic output action.
+  */
+ void GHOST_XrStopHapticAction(GHOST_XrContextHandle xr_context,
+                               const char *action_set_name,
+                               const char *action_name);
+ 
+ /**
+  * Get action set custom data (owned by Blender, not GHOST).
+  */
+ void *GHOST_XrGetActionSetCustomdata(GHOST_XrContextHandle xr_context,
+                                      const char *action_set_name);
+ 
+ /**
+  * Get action custom data (owned by Blender, not GHOST).
+  */
+ void *GHOST_XrGetActionCustomdata(GHOST_XrContextHandle xr_context,
+                                   const char *action_set_name,
+                                   const char *action_name);
+ 
+ #endif /* WITH_XR_OPENXR */
  
 +#ifdef WITH_VULKAN
 +
 +/**
 + * Return vulkan handles for the given contest.
 + */
 +void GHOST_GetVulkanHandles(GHOST_ContextHandle context,
 +                            void *r_instance,
 +                            void *r_physical_device,
 +                            void *r_device,
 +                            GHOST_TUns32 *r_graphic_queue_familly);
 +
 +/**
 + * Return vulkan backbuffer resources handles for the given window.
 + */
 +void GHOST_GetVulkanBackbuffer(GHOST_WindowHandle windowhandle,
 +                               void *image,
 +                               void *framebuffer,
 +                               void *command_buffer,
 +                               void *render_pass,
 +                               void *extent,
 +                               GHOST_TUns32 *fb_id);
 +
 +#endif
 +
  #ifdef __cplusplus
  }
  
diff --cc intern/ghost/intern/GHOST_C-api.cpp
index 3fa1b1973a9,955f35274ea..a8be5213fa1
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@@ -961,38 -954,145 +962,179 @@@ int GHOST_XrSessionNeedsUpsideDownDrawi
    return 0; /* Only reached if exception is thrown. */
  }
  
- #endif
+ int GHOST_XrCreateActionSet(GHOST_XrContextHandle xr_contexthandle,
+                             const GHOST_XrActionSetInfo *info)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->createActionSet(*info), xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrDestroyActionSet(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->destroyActionSet(action_set_name), xr_context);
+ }
+ 
+ int GHOST_XrCreateActions(GHOST_XrContextHandle xr_contexthandle,
+                           const char *action_set_name,
+                           GHOST_TUns32 count,
+                           const GHOST_XrActionInfo *infos)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->createActions(action_set_name, count, infos), xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrDestroyActions(GHOST_XrContextHandle xr_contexthandle,
+                             const char *action_set_name,
+                             GHOST_TUns32 count,
+                             const char *const *action_names)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->destroyActions(action_set_name, count, action_names), xr_context);
+ }
+ 
+ int GHOST_XrCreateActionSpaces(GHOST_XrContextHandle xr_contexthandle,
+                                const char *action_set_name,
+                                GHOST_TUns32 count,
+                                const GHOST_XrActionSpaceInfo *infos)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->createActionSpaces(action_set_name, count, infos),
+                          xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrDestroyActionSpaces(GHOST_XrContextHandle xr_contexthandle,
+                                  const char *action_set_name,
+                                  GHOST_TUns32 count,
+                                  const GHOST_XrActionSpaceInfo *infos)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->destroyActionSpaces(action_set_name, count, infos), xr_context);
+ }
+ 
+ int GHOST_XrCreateActionBindings(GHOST_XrContextHandle xr_contexthandle,
+                                  const char *action_set_name,
+                                  GHOST_TUns32 count,
+                                  const GHOST_XrActionProfileInfo *infos)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->createActionBindings(action_set_name, count, infos),
+                          xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrDestroyActionBindings(GHOST_XrContextHandle xr_contexthandle,
+                                    const char *action_set_name,
+                                    GHOST_TUns32 count,
+                                    const GHOST_XrActionProfileInfo *infos)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->destroyActionBindings(action_set_name, count, infos), xr_context);
+ }
+ 
+ int GHOST_XrAttachActionSets(GHOST_XrContextHandle xr_contexthandle)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->attachActionSets(), xr_context);
+   return 0;
+ }
+ 
+ int GHOST_XrSyncActions(GHOST_XrContextHandle xr_contexthandle, const char *action_set_name)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->syncActions(action_set_name), xr_context);
+   return 0;
+ }
+ 
+ int GHOST_XrApplyHapticAction(GHOST_XrContextHandle xr_contexthandle,
+                               const char *action_set_name,
+                               const char *action_name,
+                               const GHOST_TInt64 *duration,
+                               cons

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list