Skip to content

Commit 29743f0

Browse files
committed
Address Nick note, and re-enable CMake build of imaging after bad rebase earlier today
1 parent cbcaaeb commit 29743f0

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

cmake/defaults/Options.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ if(APPLE)
5252
MESSAGE(STATUS "Setting PXR_BUILD_USD_TOOLS=OFF because they are not supported on Apple embedded platforms")
5353
set(PXR_BUILD_USD_TOOLS OFF)
5454
endif()
55-
if (${PXR_BUILD_IMAGING})
56-
MESSAGE(STATUS "Setting PXR_BUILD_USD_IMAGING=OFF because it is not supported on Apple embedded platforms")
57-
set(PXR_BUILD_IMAGING OFF)
58-
endif ()
55+
set(PXR_ENABLE_GL_SUPPORT OFF)
5956
endif ()
6057
endif()
6158

pxr/imaging/hgiMetal/texture.mm

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@
2424
MTLTextureUsage usage = MTLTextureUsageShaderRead;
2525

2626
if (desc.initialData && desc.pixelsByteSize > 0) {
27-
#if defined(ARCH_OS_OSX)
28-
resourceOptions = MTLResourceStorageModeManaged;
29-
#else
30-
resourceOptions = MTLResourceStorageModeShared;
31-
#endif
27+
id<MTLDevice> device = hgi->GetPrimaryDevice();
28+
if ([device hasUnifiedMemory]) {
29+
resourceOptions = MTLResourceStorageModeShared;
30+
} else {
31+
resourceOptions = MTLResourceStorageModeManaged;
32+
}
3233
}
3334

3435
MTLPixelFormat mtlFormat = HgiMetalConversions::GetPixelFormat(

0 commit comments

Comments
 (0)