[Bf-blender-cvs] [b65df10346f] tmp-vulkan: Merge branch 'master' into tmp-vulkan

Jeroen Bakker noreply at git.blender.org
Tue Nov 9 10:34:52 CET 2021


Commit: b65df10346f5fe47c881b183901e2d7eff775848
Author: Jeroen Bakker
Date:   Tue Nov 9 10:34:41 2021 +0100
Branches: tmp-vulkan
https://developer.blender.org/rBb65df10346f5fe47c881b183901e2d7eff775848

Merge branch 'master' into tmp-vulkan

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



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

diff --cc build_files/cmake/platform/platform_unix.cmake
index 6792fa38d48,fc0c37e4c8b..27e3e53f92b
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@@ -99,13 -99,9 +99,14 @@@ endif(
  find_package_wrapper(JPEG REQUIRED)
  find_package_wrapper(PNG REQUIRED)
  find_package_wrapper(ZLIB REQUIRED)
+ find_package_wrapper(Zstd REQUIRED)
  find_package_wrapper(Freetype REQUIRED)
  
 +if(WITH_VULKAN)
 +  find_package_wrapper(Vulkan REQUIRED)
 +  find_package(ShaderC REQUIRED)
 +endif()
 +
  if(WITH_PYTHON)
    # No way to set py35, remove for now.
    # find_package(PythonLibs)
diff --cc build_files/cmake/platform/platform_win32.cmake
index df4c152c044,e83eba74fc0..d9abf6c15f0
--- a/build_files/cmake/platform/platform_win32.cmake
+++ b/build_files/cmake/platform/platform_win32.cmake
@@@ -876,29 -874,5 +874,32 @@@ if(WITH_HARU
    endif()
  endif()
  
 +if(WITH_VULKAN)
 +  if(EXISTS ${LIBDIR}/vulkan)
 +    set(Vulkan_FOUND On)
 +    set(Vulkan_ROOT_DIR ${LIBDIR}/vulkan)
 +    set(Vulkan_INCLUDE_DIR ${Vulkan_ROOT_DIR}/include)
 +    set(Vulkan_INCLUDE_DIRS ${Vulkan_INCLUDE_DIR})
 +    set(Vulkan_LIBRARY ${Vulkan_ROOT_DIR}/lib/vulkan-1.lib)
 +    set(Vulkan_LIBRARIES ${Vulkan_LIBRARY})
 +  else()
 +    message(WARNING "vulkan was not found, disabling WITH_VULKAN")
 +    set(WITH_VULKAN OFF)
 +  endif()
 +endif()
 +
 +if(WITH_VULKAN)
 +  if(EXISTS ${LIBDIR}/shaderc)
 +    set(SHADERC_ROOT_DIR ${LIBDIR}/shaderc)
 +    set(SHADERC_INCLUDE_DIR ${SHADERC_ROOT_DIR}/include)
 +    set(SHADERC_INCLUDE_DIRS ${SHADERC_INCLUDE_DIR})
 +    set(SHADERC_LIBRARY optimized ${SHADERC_ROOT_DIR}/lib/shaderc_shared.lib debug ${SHADERC_ROOT_DIR}/lib/shaderc_shared_d.lib)
 +    set(SHADERC_LIBRARIES ${SHADERC_LIBRARY})
 +  else()
 +    message(WARNING "shaderc was not found, disabling WITH_VULKAN")
 +    set(WITH_VULKAN OFF)
 +  endif()
 +endif()
++
+ set(ZSTD_INCLUDE_DIRS ${LIBDIR}/zstd/include)
+ set(ZSTD_LIBRARIES ${LIBDIR}/zstd/lib/zstd_static.lib)
diff --cc extern/CMakeLists.txt
index 07084789bda,1fdc8e60167..c856ca931c2
--- a/extern/CMakeLists.txt
+++ b/extern/CMakeLists.txt
@@@ -111,9 -114,5 +114,9 @@@ if(WITH_MOD_FLUID
  endif()
  
  if (WITH_COMPOSITOR)
- 	add_subdirectory(smaa_areatex)
+   add_subdirectory(smaa_areatex)
  endif()
 +
 +if(WITH_VULKAN)
 +  add_subdirectory(vulkan_memory_allocator)
 +endif()
diff --cc intern/ghost/GHOST_C-api.h
index e50eddd3d2b,784febe8581..4fa3024f11b
--- a/intern/ghost/GHOST_C-api.h
+++ b/intern/ghost/GHOST_C-api.h
@@@ -1170,32 -1128,44 +1136,68 @@@ void *GHOST_XrGetActionCustomdata(GHOST
                                    const char *action_set_name,
                                    const char *action_name);
  
+ /**
+  * Get the number of actions in an action set.
+  */
+ unsigned int GHOST_XrGetActionCount(GHOST_XrContextHandle xr_context, const char *action_set_name);
+ 
+ /**
+  * Get custom data for all actions in an action set.
+  */
+ void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_context,
+                                       const char *action_set_name,
+                                       void **r_customdata_array);
+ 
+ /* controller model */
+ /**
+  * Load the OpenXR controller model.
+  */
+ int GHOST_XrLoadControllerModel(GHOST_XrContextHandle xr_context, const char *subaction_path);
+ 
+ /**
+  * Unload the OpenXR controller model.
+  */
+ void GHOST_XrUnloadControllerModel(GHOST_XrContextHandle xr_context, const char *subaction_path);
+ 
+ /**
+  * Update component transforms for the OpenXR controller model.
+  */
+ int GHOST_XrUpdateControllerModelComponents(GHOST_XrContextHandle xr_context,
+                                             const char *subaction_path);
+ 
+ /**
+  * Get vertex data for the OpenXR controller model.
+  */
+ int GHOST_XrGetControllerModelData(GHOST_XrContextHandle xr_context,
+                                    const char *subaction_path,
+                                    GHOST_XrControllerModelData *r_data);
+ 
  #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);
++                            uint32_t *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);
++                               uint32_t *fb_id);
 +
 +#endif
 +
  #ifdef __cplusplus
  }
  
diff --cc intern/ghost/GHOST_IContext.h
index 4e3209bc70f,1b5f996cb54..4b8e6c0e567
--- a/intern/ghost/GHOST_IContext.h
+++ b/intern/ghost/GHOST_IContext.h
@@@ -56,11 -56,6 +56,11 @@@ class GHOST_IContext 
  
    virtual unsigned int getDefaultFramebuffer() = 0;
  
-   virtual GHOST_TSuccess getVulkanHandles(void *, void *, void *, GHOST_TUns32 *) = 0;
++  virtual GHOST_TSuccess getVulkanHandles(void *, void *, void *, uint32_t *) = 0;
 +
 +  virtual GHOST_TSuccess getVulkanBackbuffer(
-       void *, void *, void *, void *, void *, GHOST_TUns32 *) = 0;
++      void *, void *, void *, void *, void *, uint32_t *) = 0;
 +
    virtual GHOST_TSuccess swapBuffers() = 0;
  
  #ifdef WITH_CXX_GUARDEDALLOC
diff --cc intern/ghost/GHOST_ISystem.h
index 174afbd3b53,05c6c9d907f..0e95971795b
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@@ -261,12 -261,11 +261,12 @@@ class GHOST_ISystem 
    virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window) = 0;
  
    /**
-    * Create a new offscreen context.
-    * Never explicitly delete the context, use disposeContext() instead.
+    * Create a new off-screen context.
+    * Never explicitly delete the context, use #disposeContext() instead.
     * \return The new context (or 0 if creation failed).
     */
 -  virtual GHOST_IContext *createOffscreenContext(GHOST_GLSettings glSettings) = 0;
 +  virtual GHOST_IContext *createOffscreenContext(GHOST_TDrawingContextType type,
 +                                                 GHOST_GLSettings glSettings) = 0;
  
    /**
     * Dispose of a context.
diff --cc intern/ghost/GHOST_IWindow.h
index 02978a29afc,91f576ca304..4642241845e
--- a/intern/ghost/GHOST_IWindow.h
+++ b/intern/ghost/GHOST_IWindow.h
@@@ -232,18 -218,6 +226,18 @@@ class GHOST_IWindow 
     */
    virtual unsigned int getDefaultFramebuffer() = 0;
  
 +  /**
 +   * Gets the Vulkan framebuffer related resource handles associated with the Vulkan context.
 +   * Needs to be called after each swap events as the framebuffer will change.
 +   * \return  A boolean success indicator.
 +   */
 +  virtual GHOST_TSuccess getVulkanBackbuffer(void * /*image*/,
 +                                             void * /*framebuffer*/,
 +                                             void * /*command_buffer*/,
 +                                             void * /*render_pass*/,
 +                                             void * /*extent*/,
-                                              GHOST_TUns32 * /*fb_id*/) = 0;
++                                             uint32_t * /*fb_id*/) = 0;
 +
    /**
     * Invalidates the contents of this window.
     * \return Indication of success.
diff --cc intern/ghost/intern/GHOST_C-api.cpp
index a8be5213fa1,a21c3a90c06..4d166a8dd1c
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@@ -1103,38 -1050,58 +1058,92 @@@ void *GHOST_XrGetActionCustomdata(GHOST
    return 0;
  }
  
+ unsigned int GHOST_XrGetActionCount(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->getActionCount(action_set_name), xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrGetActionCustomdataArray(GHOST_XrContextHandle xr_contexthandle,
+                                       const char *action_set_name,
+                                       void **r_customdata_array)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->getActionCustomdataArray(action_set_name, r_customdata_array),
+                      xr_context);
+ }
+ 
+ int GHOST_XrLoadControllerModel(GHOST_XrContextHandle xr_contexthandle, const char *subaction_path)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->loadControllerModel(subaction_path), xr_context);
+   return 0;
+ }
+ 
+ void GHOST_XrUnloadControllerModel(GHOST_XrContextHandle xr_contexthandle,
+                                    const char *subaction_path)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL(xr_session->unloadControllerModel(subaction_path), xr_context);
+ }
+ 
+ int GHOST_XrUpdateControllerModelComponents(GHOST_XrContextHandle xr_contexthandle,
+                                             const char *subaction_path)
+ {
+   GHOST_IXrContext *xr_context = (GHOST_IXrContext *)xr_contexthandle;
+   GHOST_XrSession *xr_session = xr_context->getSession();
+   GHOST_XR_CAPI_CALL_RET(xr_session->updateControllerModelComponents(subaction_path), xr_context);
+   return 0;
+ }
+ 
+ int GHOST_XrGetControllerModelData(GHOST_XrContextHandle xr_contexthandle,
+                                    const char *subaction_path,
+                                    GHOST_XrControllerModelData *r_data)
+ {
+ 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list