Browse Source

OSX: Added weak framework for linking Metal.

Branimir Karadžić 10 years ago
parent
commit
caf305ceb1
3 changed files with 5 additions and 5 deletions
  1. 1 1
      scripts/bgfx.lua
  2. 2 2
      scripts/genie.lua
  3. 2 2
      src/renderer_mtl.mm

+ 1 - 1
scripts/bgfx.lua

@@ -83,9 +83,9 @@ function bgfxProject(_name, _kind, _defines)
 		configuration { "osx" }
 			linkoptions {
 				"-framework Cocoa",
-				"-framework Metal",
 				"-framework QuartzCore",
 				"-framework OpenGL",
+				"-weak_framework Metal",
 			}
 
 		configuration { "not nacl" }

+ 2 - 2
scripts/genie.lua

@@ -326,9 +326,9 @@ function exampleProject(_name)
 	configuration { "osx" }
 		linkoptions {
 			"-framework Cocoa",
-			"-framework Metal",
 			"-framework QuartzCore",
 			"-framework OpenGL",
+			"-weak_framework Metal",
 		}
 
 	configuration { "ios* or tvos*" }
@@ -336,10 +336,10 @@ function exampleProject(_name)
 		linkoptions {
 			"-framework CoreFoundation",
 			"-framework Foundation",
-			"-framework Metal",
 			"-framework OpenGLES",
 			"-framework UIKit",
 			"-framework QuartzCore",
+			"-weak_framework Metal",
 		}
 
 	configuration { "xcode4", "ios" }

+ 2 - 2
src/renderer_mtl.mm

@@ -329,10 +329,10 @@ namespace bgfx { namespace mtl
 			: m_metalLayer(NULL)
 			, m_backBufferPixelFormatHash(0)
 			, m_maxAnisotropy(1)
+			, m_uniformBufferIndex(0)
 			, m_numWindows(1)
 			, m_rtMsaa(false)
 			, m_drawable(NULL)
-			, m_uniformBufferIndex(0)
 		{
 		}
 
@@ -1231,7 +1231,7 @@ namespace bgfx { namespace mtl
 
 		OcclusionQueryMTL m_occlusionQuery;
 
-		Buffer	 m_uniformBuffer;
+		Buffer   m_uniformBuffer;
 		Buffer   m_uniformBuffers[UNIFORM_BUFFER_COUNT];
 		uint32_t m_uniformBufferVertexOffset;
 		uint32_t m_uniformBufferFragmentOffset;