Skip to content

Commit

Permalink
Fix macOS and iOS builds on older versions of Xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahmen issam committed Jul 19, 2023
1 parent 8ab41d3 commit 1b93817
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/renderer_mtl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,14 @@ bool init(const Init& _init)
{
g_caps.vendorId = BGFX_PCI_ID_APPLE;

#if ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 160000))
if ([m_device supportsFamily: MTLGPUFamilyApple8])
{
g_caps.deviceId = 1008;
}
else if ([m_device supportsFamily: MTLGPUFamilyApple7])
else
#endif
if ([m_device supportsFamily: MTLGPUFamilyApple7])
{
g_caps.deviceId = 1007;
}
Expand Down Expand Up @@ -2337,7 +2340,11 @@ void processArguments(

if (NULL != reflection)
{
#if ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 160000))
processArguments(pso, reflection.vertexBindings, reflection.fragmentBindings);
#else
processArguments(pso, reflection.vertexArguments, reflection.fragmentArguments);
#endif
}
}

Expand Down Expand Up @@ -2384,7 +2391,12 @@ void processArguments(
, MTLPipelineOptionBufferTypeInfo
, &reflection
);

#if ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000) || (__IPHONE_OS_VERSION_MAX_ALLOWED >= 160000))
processArguments(pso, reflection.bindings, NULL);
#else
processArguments(pso, reflection.arguments, NULL);
#endif

for (uint32_t ii = 0; ii < 3; ++ii)
{
Expand Down

0 comments on commit 1b93817

Please sign in to comment.