[Bf-blender-cvs] [8335da48f95] xr-actions-D9124: Cleanup: Comments

Peter Kim noreply at git.blender.org
Fri Nov 6 13:41:35 CET 2020


Commit: 8335da48f957126a38549c73e472780704b8f03c
Author: Peter Kim
Date:   Fri Nov 6 17:08:42 2020 +0900
Branches: xr-actions-D9124
https://developer.blender.org/rB8335da48f957126a38549c73e472780704b8f03c

Cleanup: Comments

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

M	intern/ghost/intern/GHOST_XrSession.cpp
M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/xr/intern/wm_xr_session.c

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

diff --git a/intern/ghost/intern/GHOST_XrSession.cpp b/intern/ghost/intern/GHOST_XrSession.cpp
index 91f6328eae5..95bc697b705 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -1062,9 +1062,7 @@ bool GHOST_XrSession::attachActionSets()
   XrSessionActionSetsAttachInfo attach_info{XR_TYPE_SESSION_ACTION_SETS_ATTACH_INFO};
   attach_info.countActionSets = (uint32_t)m_oxr->action_sets.size();
 
-  /* Create an aligned copy of the action sets to pass to xrAttachSessionActionSets().
-   * Not that much of a performance concern since attachActionSets() should only be called once
-   * per session. */
+  /* Create an aligned copy of the action sets to pass to xrAttachSessionActionSets(). */
   std::vector<XrActionSet> action_sets(attach_info.countActionSets);
   uint32_t i = 0;
   for (auto &action_set : m_oxr->action_sets) {
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index a7cee30a795..6791c0de3eb 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3214,7 +3214,7 @@ static void wm_event_surface_free_all(wmXrSurfaceData *surface_data)
 
 static void wm_event_do_surface_handlers(bContext *C, wmSurface *surface)
 {
-  /* TODO_XR: Currently assumes that the XR surface is the
+  /* Note: Currently assumes that the XR surface is the
    * same as the one for the XR runtime. In the future this
    * might not always be the case. */
   wmWindowManager *wm = CTX_wm_manager(C);
@@ -3265,18 +3265,18 @@ static void wm_event_do_surface_handlers(bContext *C, wmSurface *surface)
       LISTBASE_FOREACH (wmEvent *, event, events) {
         wmXrActionData *action_data = event->customdata;
         PointerRNA properties = {.type = action_data->ot->srna,
-                                  .data = action_data->op_properties};
+                                 .data = action_data->op_properties};
 
         if (action_data->ot->invoke || action_data->ot->invoke_3d) {
           /* Invoke operator, either executing operator or transferring responsibility to window
-            * modal handlers. */
+           * modal handlers. */
           wm_operator_invoke(C,
-                              action_data->ot,
-                              event,
-                              action_data->op_properties ? &properties : NULL,
-                              NULL,
-                              false,
-                              false);
+                             action_data->ot,
+                             event,
+                             action_data->op_properties ? &properties : NULL,
+                             NULL,
+                             false,
+                             false);
         }
         else {
           /* Execute operator. */
diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c
index 94345a1c09b..bd97b84b327 100644
--- a/source/blender/windowmanager/xr/intern/wm_xr_session.c
+++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c
@@ -765,16 +765,15 @@ static void wm_xr_session_action_set_update(const XrSessionSettings *settings,
   }
 
   /* Create an aligned list of action infos. */
-  /* TODO_XR: Store array and number of actions to avoid allocation on each call. */
   GHOST_XrActionInfo **infos = MEM_callocN(sizeof(GHOST_XrActionInfo *) * count, __func__);
 
   GHashIterator *ghi = BLI_ghashIterator_new(actions);
   unsigned int i = 0;
   GHASH_ITER (*ghi, actions) {
+    /* Cast wmXrAction to GHOST_XrActionInfo. */
     BLI_STATIC_ASSERT(sizeof(wmXrAction) == sizeof(GHOST_XrActionInfo),
                       "wmXrAction and GHOST_XrActionInfo sizes do not match.");
-    infos[i] = BLI_ghashIterator_getValue(
-        ghi); /* TODO_XR: Avoid casting wmXrAction to GHOST_XrActionInfo. */
+    infos[i] = BLI_ghashIterator_getValue(ghi);
     ++i;
   }
   BLI_ghashIterator_free(ghi);



More information about the Bf-blender-cvs mailing list