Skip to content

Commit 38653a8

Browse files
furby-tmdgovil
authored andcommitted
Fix Garch opengl check, add ARC conditionals to HgiMetal.
* Note blitCmds.mm is still using the wrong MTLResource type on L.361, which should be MTLBuffer, but that issue is addressed in the following PR: #3226 Signed-off-by: furby™ <devs@wabi.foundation>
1 parent c543ca2 commit 38653a8

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

pxr/imaging/garch/glPlatformContextDarwin.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "pxr/pxr.h"
1010
#include "glPlatformContextDarwin.h"
1111

12-
#if defined(PXR_OPENGL_SUPPORT_ENABLED)
12+
#if defined(PXR_GL_SUPPORT_ENABLED)
1313
#ifdef ARCH_OS_OSX
1414
#import <AppKit/NSOpenGL.h>
1515
typedef NSOpenGLContext NSGLContext;
@@ -27,7 +27,7 @@
2727
{
2828
public:
2929
Detail() {
30-
#if defined(PXR_OPENGL_SUPPORT_ENABLED)
30+
#if defined(PXR_GL_SUPPORT_ENABLED)
3131
context = [NSGLContext currentContext];
3232
#else
3333
context = nil;
@@ -82,7 +82,7 @@
8282
void
8383
GarchNSGLContextState::MakeCurrent()
8484
{
85-
#if defined(PXR_OPENGL_SUPPORT_ENABLED)
85+
#if defined(PXR_GL_SUPPORT_ENABLED)
8686
#if defined(ARCH_OS_IPHONE)
8787
[EAGLContext setCurrentContext:_detail->context];
8888
#else
@@ -95,7 +95,7 @@
9595
void
9696
GarchNSGLContextState::DoneCurrent()
9797
{
98-
#if defined(PXR_OPENGL_SUPPORT_ENABLED)
98+
#if defined(PXR_GL_SUPPORT_ENABLED)
9999
#if defined(ARCH_OS_IPHONE)
100100
[EAGLContext setCurrentContext:nil];
101101
#else

pxr/imaging/hgiMetal/blitCmds.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,7 @@
353353
memcpy(dst + dstOffset, src, copyOp.byteSize);
354354
}
355355

356+
#if defined(ARCH_OS_OSX)
356357
if (!sharedBuffer &&
357358
[metalBuffer->GetBufferId()
358359
respondsToSelector:@selector(didModifyRange:)]) {
@@ -364,6 +365,7 @@
364365
[resource didModifyRange:range];
365366
ARCH_PRAGMA_POP
366367
}
368+
#endif // defined(ARCH_OS_OSX)
367369
}
368370

369371
void

pxr/imaging/hgiMetal/indirectCommandEncoder.mm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@
115115
}
116116

117117
HgiMetalIndirectCommandEncoder::~HgiMetalIndirectCommandEncoder() {
118+
#if !__has_feature(objc_arc)
118119
[_triangleTessFactors release];
119120
[_quadTessFactors release];
121+
#endif // !__has_feature(objc_arc)
120122
}
121123

122124
std::string

0 commit comments

Comments
 (0)