[Bf-blender-cvs] [6d82ae3581e] tmp-vulkan: Vulkan: Fix compilation on OSX

Clément Foucault noreply at git.blender.org
Sun Sep 13 03:38:06 CEST 2020


Commit: 6d82ae3581e25a0ecc2a6fed6ce5e8c99c35b52b
Author: Clément Foucault
Date:   Sun Sep 13 01:40:19 2020 +0200
Branches: tmp-vulkan
https://developer.blender.org/rB6d82ae3581e25a0ecc2a6fed6ce5e8c99c35b52b

Vulkan: Fix compilation on OSX

This was caused by an internal metal type. The fix is a
workaround since I could not find the right solution.

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

M	intern/ghost/intern/GHOST_ContextVK.cpp
M	intern/ghost/intern/GHOST_ContextVK.h

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

diff --git a/intern/ghost/intern/GHOST_ContextVK.cpp b/intern/ghost/intern/GHOST_ContextVK.cpp
index 556a8e39370..d0ffe743d6a 100644
--- a/intern/ghost/intern/GHOST_ContextVK.cpp
+++ b/intern/ghost/intern/GHOST_ContextVK.cpp
@@ -809,7 +809,7 @@ GHOST_TSuccess GHOST_ContextVK::initializeDrawingContext()
 #ifdef _WIN32
   const bool use_window_surface = (m_hwnd != NULL);
 #elif defined(__APPLE__)
-  const bool use_window_surface = true;
+  const bool use_window_surface = (m_metal_layer != NULL);
 #else /* X11 */
   const bool use_window_surface = (m_display != NULL);
 #endif
diff --git a/intern/ghost/intern/GHOST_ContextVK.h b/intern/ghost/intern/GHOST_ContextVK.h
index 506525133e2..865ee2aba2d 100644
--- a/intern/ghost/intern/GHOST_ContextVK.h
+++ b/intern/ghost/intern/GHOST_ContextVK.h
@@ -63,7 +63,8 @@ class GHOST_ContextVK : public GHOST_Context {
 #ifdef _WIN32
                   HWND hwnd,
 #elif defined(__APPLE__)
-                  CAMetalLayer *metal_layer,
+                  /* FIXME CAMetalLayer but have issue with linking. */
+                  void *metal_layer,
 #else /* X11 */
                   Window window,
                   Display *display,
@@ -132,7 +133,8 @@ class GHOST_ContextVK : public GHOST_Context {
 #ifdef _WIN32
   HWND hwnd;
 #elif defined(__APPLE__)
-  CAMetalLayer *m_metal_layer;
+  /* FIXME CAMetalLayer but have issue with linking. */
+  void *m_metal_layer;
 #else /* X11 */
   Display *m_display;
   Window m_window;



More information about the Bf-blender-cvs mailing list