diff --git a/pxr/imaging/hgiMetal/graphicsCmds.mm b/pxr/imaging/hgiMetal/graphicsCmds.mm index bd879d68a0..8f462babf0 100644 --- a/pxr/imaging/hgiMetal/graphicsCmds.mm +++ b/pxr/imaging/hgiMetal/graphicsCmds.mm @@ -111,11 +111,13 @@ // The GPU culling pass is only a vertex shader, so it doesn't have any // render targets bound to it. To prevent an API validation error, set // some default values for the target. +#if (defined(__MAC_10_15) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15) if (!desc.HasAttachments()) { _renderPassDescriptor.renderTargetWidth = 256; _renderPassDescriptor.renderTargetHeight = 256; _renderPassDescriptor.defaultRasterSampleCount = 1; } +#endif // Color attachments bool resolvingColor = !desc.colorResolveTextures.empty(); diff --git a/pxr/imaging/hgiMetal/shaderFunction.mm b/pxr/imaging/hgiMetal/shaderFunction.mm index 8c77c51f5d..e756599b71 100644 --- a/pxr/imaging/hgiMetal/shaderFunction.mm +++ b/pxr/imaging/hgiMetal/shaderFunction.mm @@ -51,7 +51,11 @@ options.fastMathEnabled = YES; if (@available(macOS 10.15, ios 13.0, *)) { +#if (defined(__MAC_10_15) && __MAC_OS_X_VERSION_MAX_ALLOWED >= __MAC_10_15) options.languageVersion = MTLLanguageVersion2_2; +#else + options.languageVersion = MTLLanguageVersion2_1; +#endif } else { options.languageVersion = MTLLanguageVersion2_1; }