Skip to content

Commit

Permalink
Fix for Mac SDK 10.15
Browse files Browse the repository at this point in the history
  • Loading branch information
seando-adsk committed Nov 15, 2022
1 parent 2e2c495 commit 462d2de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pxr/imaging/hgiMetal/graphicsCmds.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions pxr/imaging/hgiMetal/shaderFunction.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 462d2de

Please sign in to comment.