diff --git a/src/renderer_mtl.h b/src/renderer_mtl.h index 3ce8d86b5b..f5f0933d2a 100644 --- a/src/renderer_mtl.h +++ b/src/renderer_mtl.h @@ -33,6 +33,29 @@ BGFX_PROFILER_END(); \ BX_MACRO_BLOCK_END +#ifndef BX_XCODE_14 +# define BX_XCODE_14 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 130000) || \ + (__IPHONE_OS_VERSION_MAX_ALLOWED >= 160000)) +#endif +#ifndef BX_XCODE_13 +# define BX_XCODE_13 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 120000) || \ + (__IPHONE_OS_VERSION_MAX_ALLOWED >= 150000)) +#endif +#ifndef BX_XCODE_12 +# define BX_XCODE_12 ((__MAC_OS_X_VERSION_MAX_ALLOWED >= 110000) || \ + (__IPHONE_OS_VERSION_MAX_ALLOWED >= 140000)) +#endif + +#if !(BX_PLATFORM_IOS || (BX_PLATFORM_OSX && BX_XCODE_12)) +# define MTLGPUFamilyApple6 MTLGPUFamily(1006) +#endif +#if !((BX_PLATFORM_IOS || BX_PLATFORM_OSX) && BX_XCODE_12) +# define MTLGPUFamilyApple7 MTLGPUFamily(1007) +#endif +#if !(BX_XCODE_14 || (BX_PLATFORM_IOS && BX_XCODE_13)) +# define MTLGPUFamilyApple8 MTLGPUFamily(1008) +#endif + namespace bgfx { namespace mtl { //runtime os check diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 55b9ea013a..2e66013c07 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -2337,7 +2337,11 @@ void processArguments( if (NULL != reflection) { +#if BX_XCODE_14 processArguments(pso, reflection.vertexBindings, reflection.fragmentBindings); +#else + processArguments(pso, reflection.vertexArguments, reflection.fragmentArguments); +#endif } } @@ -2384,7 +2388,11 @@ void processArguments( , MTLPipelineOptionBufferTypeInfo , &reflection ); +#if BX_XCODE_14 processArguments(pso, reflection.bindings, NULL); +#else + processArguments(pso, reflection.arguments, NULL); +#endif for (uint32_t ii = 0; ii < 3; ++ii) {