[Bf-blender-cvs] [6af2f222cae] soc-2019-openxr: Cleanup: Comment style

Julian Eisel noreply at git.blender.org
Tue Sep 17 19:02:20 CEST 2019


Commit: 6af2f222caea5cbd3255372ba9dabe6a842648a9
Author: Julian Eisel
Date:   Tue Sep 17 19:02:01 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB6af2f222caea5cbd3255372ba9dabe6a842648a9

Cleanup: Comment style

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

M	intern/ghost/GHOST_C-api.h
M	intern/ghost/intern/GHOST_C-api.cpp
M	intern/ghost/intern/GHOST_IXrGraphicsBinding.h
M	intern/ghost/intern/GHOST_Xr.cpp
M	intern/ghost/intern/GHOST_XrContext.cpp
M	intern/ghost/intern/GHOST_XrContext.h
M	intern/ghost/intern/GHOST_XrEvent.cpp
M	intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
M	intern/ghost/intern/GHOST_XrSession.cpp
M	intern/ghost/intern/GHOST_XrSession.h
M	source/blender/editors/space_view3d/view3d_draw.c

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

diff --git a/intern/ghost/GHOST_C-api.h b/intern/ghost/GHOST_C-api.h
index 96425f7f72f..3ea2faf4afe 100644
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@ -962,7 +962,7 @@ extern void GHOST_EndIME(GHOST_WindowHandle windowhandle);
 
 #ifdef WITH_OPENXR
 
-/* xr-context */
+/* XR-context */
 
 /**
  * Set a custom callback to be executed whenever an error occurs. Should be set before calling
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index d0f068f5e3c..2b98b5e66f7 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -910,7 +910,7 @@ 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.
+  return 0; /* Only reached if exception is thrown. */
 }
 
 void GHOST_XrSessionDrawViews(GHOST_XrContextHandle xr_contexthandle, void *draw_customdata)
diff --git a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
index 93eca1aa243..4cc71d19f21 100644
--- a/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
+++ b/intern/ghost/intern/GHOST_IXrGraphicsBinding.h
@@ -61,7 +61,7 @@ class GHOST_IXrGraphicsBinding {
                                  const GHOST_XrDrawViewInfo *draw_info) = 0;
 
  protected:
-  /* Use GHOST_XrGraphicsBindingCreateFromType */
+  /* Use GHOST_XrGraphicsBindingCreateFromType! */
   GHOST_IXrGraphicsBinding() = default;
 };
 
diff --git a/intern/ghost/intern/GHOST_Xr.cpp b/intern/ghost/intern/GHOST_Xr.cpp
index 3d89e860dae..726d068552b 100644
--- a/intern/ghost/intern/GHOST_Xr.cpp
+++ b/intern/ghost/intern/GHOST_Xr.cpp
@@ -38,8 +38,8 @@ GHOST_XrContextHandle GHOST_XrContextCreate(const GHOST_XrContextCreateInfo *cre
 {
   GHOST_XrContext *xr_context = new GHOST_XrContext(create_info);
 
-  // TODO GHOST_XrContext's should probably be owned by the GHOST_System, which will handle context
-  // creation and destruction. Try-catch logic can be moved to C-API then.
+  /* TODO GHOST_XrContext's should probably be owned by the GHOST_System, which will handle context
+   * creation and destruction. Try-catch logic can be moved to C-API then. */
   try {
     xr_context->initialize(create_info);
   }
diff --git a/intern/ghost/intern/GHOST_XrContext.cpp b/intern/ghost/intern/GHOST_XrContext.cpp
index 37a8204fae6..a829d91e917 100644
--- a/intern/ghost/intern/GHOST_XrContext.cpp
+++ b/intern/ghost/intern/GHOST_XrContext.cpp
@@ -178,14 +178,14 @@ static XrBool32 debug_messenger_func(XrDebugUtilsMessageSeverityFlagsEXT /*messa
 {
   puts("OpenXR Debug Message:");
   puts(callbackData->message);
-  return XR_FALSE;  // OpenXR spec suggests always returning false.
+  return XR_FALSE; /* OpenXR spec suggests always returning false. */
 }
 
 void GHOST_XrContext::initDebugMessenger()
 {
   XrDebugUtilsMessengerCreateInfoEXT create_info{XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT};
 
-  /* Extension functions need to be obtained through xrGetInstanceProcAddr */
+  /* Extension functions need to be obtained through xrGetInstanceProcAddr(). */
   if (XR_FAILED(xrGetInstanceProcAddr(
           m_oxr->instance,
           "xrCreateDebugUtilsMessengerEXT",
@@ -319,7 +319,7 @@ void GHOST_XrContext::enumerateApiLayers()
   CHECK_XR(xrEnumerateApiLayerProperties(layer_count, &layer_count, m_oxr->layers.data()),
            "Failed to query OpenXR runtime information. Do you have an active runtime set up?");
   for (XrApiLayerProperties &layer : m_oxr->layers) {
-    /* Each layer may have own extensions */
+    /* Each layer may have own extensions. */
     enumerateExtensionsEx(m_oxr->extensions, layer.layerName);
   }
 }
@@ -396,7 +396,7 @@ void GHOST_XrContext::getExtensionsToEnable(std::vector<const char *> &r_ext_nam
 
   try_ext.clear();
 
-  /* Try enabling debug extension */
+  /* Try enabling debug extension. */
 #ifndef WIN32
   XR_DEBUG_ONLY_CALL(this, try_ext.push_back(XR_EXT_DEBUG_UTILS_EXTENSION_NAME));
 #endif
diff --git a/intern/ghost/intern/GHOST_XrContext.h b/intern/ghost/intern/GHOST_XrContext.h
index 6f5c6ab425c..8ebca096def 100644
--- a/intern/ghost/intern/GHOST_XrContext.h
+++ b/intern/ghost/intern/GHOST_XrContext.h
@@ -26,9 +26,9 @@
 #include "GHOST_IXrContext.h"
 
 struct GHOST_XrCustomFuncs {
-  /** Function to retrieve (possibly create) a graphics context */
+  /** Function to retrieve (possibly create) a graphics context. */
   GHOST_XrGraphicsContextBindFn gpu_ctx_bind_fn{nullptr};
-  /** Function to release (possibly free) a graphics context */
+  /** Function to release (possibly free) a graphics context. */
   GHOST_XrGraphicsContextUnbindFn gpu_ctx_unbind_fn{nullptr};
 
   /** Custom per-view draw function for Blender side drawing. */
@@ -91,16 +91,16 @@ class GHOST_XrContext : public GHOST_IXrContext {
   /** Active graphics binding type. */
   GHOST_TXrGraphicsBinding m_gpu_binding_type{GHOST_kXrGraphicsUnknown};
 
-  /** Names of enabled extensions */
+  /** Names of enabled extensions. */
   std::vector<const char *> m_enabled_extensions;
-  /** Names of enabled API-layers */
+  /** Names of enabled API-layers. */
   std::vector<const char *> m_enabled_layers;
 
   static GHOST_XrErrorHandlerFn s_error_handler;
   static void *s_error_handler_customdata;
   GHOST_XrCustomFuncs m_custom_funcs;
 
-  /** Enable debug message prints and OpenXR API validation layers */
+  /** Enable debug message prints and OpenXR API validation layers. */
   bool m_debug{false};
   bool m_debug_time{false};
 
diff --git a/intern/ghost/intern/GHOST_XrEvent.cpp b/intern/ghost/intern/GHOST_XrEvent.cpp
index 8234bfe07cf..25553508af0 100644
--- a/intern/ghost/intern/GHOST_XrEvent.cpp
+++ b/intern/ghost/intern/GHOST_XrEvent.cpp
@@ -26,7 +26,7 @@
 
 static bool GHOST_XrEventPollNext(XrInstance instance, XrEventDataBuffer &r_event_data)
 {
-  /* (Re-)initialize as required by specification */
+  /* (Re-)initialize as required by specification. */
   r_event_data.type = XR_TYPE_EVENT_DATA_BUFFER;
   r_event_data.next = nullptr;
 
@@ -36,20 +36,19 @@ static bool GHOST_XrEventPollNext(XrInstance instance, XrEventDataBuffer &r_even
 GHOST_TSuccess GHOST_XrEventsHandle(GHOST_XrContextHandle xr_contexthandle)
 {
   GHOST_XrContext *xr_context = (GHOST_XrContext *)xr_contexthandle;
-  XrEventDataBuffer event_buffer; /* structure big enought to hold all possible events */
+  XrEventDataBuffer event_buffer; /* Structure big enough to hold all possible events. */
 
   if (xr_context == NULL) {
     return GHOST_kFailure;
   }
 
   while (GHOST_XrEventPollNext(xr_context->getInstance(), event_buffer)) {
-    XrEventDataBaseHeader *event = (XrEventDataBaseHeader *)&event_buffer; /* base event struct */
+    XrEventDataBaseHeader *event = (XrEventDataBaseHeader *)&event_buffer;
 
     switch (event->type) {
       case XR_TYPE_EVENT_DATA_SESSION_STATE_CHANGED:
         xr_context->handleSessionStateChange((XrEventDataSessionStateChanged *)event);
         return GHOST_kSuccess;
-
       case XR_TYPE_EVENT_DATA_INSTANCE_LOSS_PENDING:
         GHOST_XrContextDestroy(xr_contexthandle);
         return GHOST_kSuccess;
diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
index c425199c983..5b98a663947 100644
--- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
+++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cpp
@@ -114,7 +114,7 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
     oxr_binding.wgl.hGLRC = ctx_wgl->m_hGLRC;
 #endif
 
-    /* Generate a framebuffer to use for blitting into the texture */
+    /* Generate a framebuffer to use for blitting into the texture. */
     glGenFramebuffers(1, &m_fbo);
   }
 
@@ -130,14 +130,14 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding {
     std::vector<XrSwapchainImageOpenGLKHR> ogl_images(image_count);
     std::vector<XrSwapchainImageBaseHeader *> base_images;
 
-    // Need to return vector of base header pointers, so of a different type. Need to build a new
-    // list with this type, and keep the initial one alive.
+    /* Need to return vector of base header pointers, so of a different type. Need to build a new
+     * list with this type, and keep the initial one alive. */
     for (XrSwapchainImageOpenGLKHR &image : ogl_images) {
       image.type = XR_TYPE_SWAPCHAIN_IMAGE_OPENGL_KHR;
       base_images.push_back(reinterpret_cast<XrSwapchainImageBaseHeader *>(&image));
     }
 
-    // Keep alive.
+    /* Keep alive. */
     m_image_cache.push_back(std::move(ogl_images));
 
     return base_images;
@@ -226,14 +226,14 @@ class GHOST_XrGraphicsBindingD3D : public GHOST_IXrGraphicsBinding {
     std::vector<XrSwapchainImageD3D11KHR> d3d_images(image_count);
     std::vector<XrSwapchainImageBaseHeader *> base_images;
 
-    // Need to return vector of base header pointers, so of a different type. Need to build a new
-    // list with this type, and keep the initial one alive.
+    /* Need to return vector of base header pointers, so of a different type. Need to build a new
+     * list with this type, and keep the initial one alive. */
     for (XrSwapchainImageD3D11KHR &image : d3d_images) {
       image.type = XR_TYPE_SWAPCHAIN_IMAGE_D3D11_KHR;
       base_images.push_back(reinterpret_cast<XrSwapchainImageBaseHeader *>(&image));
     }
 
-    // Keep alive.
+    /* Keep alive. */
     m_image_cache.push_back(std::move(d3d_images));
 
     return base_images;
diff --git a/intern/ghost/intern/GHOST_XrSession.cpp b/intern/ghost/intern/GHOST_XrSession.cpp
index debd86e4e48..2ed2b229a76 100644
--- a/intern/ghost/intern/GHOST_XrSession.cpp
+++ b/intern/ghost/intern/GHOST_XrSession.cpp
@@ -39,7 +39,7 @@ struct OpenXRSessionData {
   XrSession session{XR_NULL_HANDLE};
   XrSessionState session_state{XR_SESSION_STATE_UNKNOWN};
 
-  // Only stereo rendering supported now.
+  /* Only stereo rendering supported now. */
   const XrViewConfigurationType view_type{XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO};
   XrSpace reference_space;
   std::vector<Xr

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list