Skip to content

Commit

Permalink
[usd] Bump to v24.08
Browse files Browse the repository at this point in the history
  • Loading branch information
theblackunknown committed Nov 11, 2024
1 parent 813a241 commit 4fb6441
Show file tree
Hide file tree
Showing 22 changed files with 1,119 additions and 77 deletions.
43 changes: 43 additions & 0 deletions ports/usd/001-fix_rename_find_package_to_find_dependency.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index b26f1ea31..afe3dc448 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -16,6 +16,8 @@ set(PXR_MINOR_VERSION "@PXR_MINOR_VERSION@")
set(PXR_PATCH_VERSION "@PXR_PATCH_VERSION@")
set(PXR_VERSION "@PXR_VERSION@")

+include(CMakeFindDependencyMacro)
+
# If Python support was enabled for this USD build, find the import
# targets by invoking the appropriate FindPython module. Use the same
# LIBRARY and INCLUDE_DIR settings from the original build if they
@@ -41,9 +43,9 @@ if(@PXR_ENABLE_PYTHON_SUPPORT@)
endif()

if (NOT DEFINED Python3_VERSION)
- find_package(Python3 "@Python3_VERSION@" EXACT COMPONENTS Development REQUIRED)
+ find_dependency(Python3 "@Python3_VERSION@" EXACT COMPONENTS Development)
else()
- find_package(Python3 COMPONENTS Development REQUIRED)
+ find_dependency(Python3 COMPONENTS Development)
endif()
endif()

@@ -57,7 +59,7 @@ if(@PXR_ENABLE_MATERIALX_SUPPORT@)
set(MaterialX_DIR [[@MaterialX_DIR@]])
endif()
endif()
- find_package(MaterialX REQUIRED)
+ find_dependency(MaterialX)
endif()

# Similar to MaterialX above, we are using Imath's cmake package config, so set
@@ -71,7 +73,7 @@ if(@Imath_FOUND@)
set(Imath_DIR [[@Imath_DIR@]])
endif()
endif()
- find_package(Imath REQUIRED)
+ find_dependency(Imath)
endif()

include("${PXR_CMAKE_DIR}/cmake/pxrTargets.cmake")
27 changes: 27 additions & 0 deletions ports/usd/002-vcpkg_find_tbb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index fe60570b3..ccaabe765 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -137,7 +137,8 @@ endif()


# --TBB
-find_package(TBB REQUIRED COMPONENTS tbb)
+find_package(TBB CONFIG REQUIRED)
+set(TBB_tbb_LIBRARY TBB::tbb)
add_definitions(${TBB_DEFINITIONS})

# --math
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index afe3dc448..041cd8cba 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -18,6 +18,8 @@ set(PXR_VERSION "@PXR_VERSION@")

include(CMakeFindDependencyMacro)

+find_dependency(TBB CONFIG)
+
# If Python support was enabled for this USD build, find the import
# targets by invoking the appropriate FindPython module. Use the same
# LIBRARY and INCLUDE_DIR settings from the original build if they
34 changes: 34 additions & 0 deletions ports/usd/003-vcpkg_find_opensubdiv.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index ccaabe765..d4eea2988 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -260,8 +260,12 @@ if (PXR_BUILD_IMAGING)
endif()
endif()
# --Opensubdiv
- set(OPENSUBDIV_USE_GPU ${PXR_ENABLE_GL_SUPPORT})
- find_package(OpenSubdiv 3 REQUIRED)
+ find_package(OpenSubdiv 3 CONFIG REQUIRED)
+ set(OPENSUBDIV_LIBRARIES OpenSubdiv::osdCPU_static)
+ set(OPENSUBDIV_OSDCPU_LIBRARY OpenSubdiv::osdCPU_static) # For compatibility
+ if(PXR_ENABLE_GL_SUPPORT)
+ list(APPEND OPENSUBDIV_LIBRARIES OpenSubdiv::osdGPU_static)
+ endif()
# --Ptex
if (PXR_ENABLE_PTEX_SUPPORT)
find_package(PTex REQUIRED)
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index 041cd8cba..692d045b9 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -20,6 +20,10 @@ include(CMakeFindDependencyMacro)

find_dependency(TBB CONFIG)

+if(@PXR_BUILD_IMAGING@)
+ find_dependency(OpenSubdiv 3 CONFIG)
+endif()
+
# If Python support was enabled for this USD build, find the import
# targets by invoking the appropriate FindPython module. Use the same
# LIBRARY and INCLUDE_DIR settings from the original build if they
57 changes: 57 additions & 0 deletions ports/usd/004-vcpkg_find_openimageio.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index d4eea2988..106fd15e2 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -196,7 +196,8 @@ if (PXR_BUILD_IMAGING)
# --OpenImageIO
if (PXR_BUILD_OPENIMAGEIO_PLUGIN)
set(REQUIRES_Imath TRUE)
- find_package(OpenImageIO REQUIRED)
+ find_package(OpenImageIO CONFIG REQUIRED)
+ set(OIIO_LIBRARIES OpenImageIO::OpenImageIO)
add_definitions(-DPXR_OIIO_PLUGIN_ENABLED)
if (OIIO_idiff_BINARY)
set(IMAGE_DIFF_TOOL ${OIIO_idiff_BINARY} CACHE STRING "Uses idiff for image diffing")
diff --git a/pxr/imaging/plugin/hioOiio/CMakeLists.txt b/pxr/imaging/plugin/hioOiio/CMakeLists.txt
index 0a055b711..de4b73a47 100644
--- a/pxr/imaging/plugin/hioOiio/CMakeLists.txt
+++ b/pxr/imaging/plugin/hioOiio/CMakeLists.txt
@@ -7,6 +7,7 @@ if (NOT ${PXR_BUILD_GPU_SUPPORT})
return()
endif()

+if(0) # No need because OpenImageIO::OpenImageIO already declare its transitive dependencies correctly
# Use the import targets set by Imath's package config
if (Imath_FOUND)
set(__OIIO_IMATH_LIBS "Imath::Imath")
@@ -14,6 +15,7 @@ else()
set(__OIIO_IMATH_INCLUDE ${OPENEXR_INCLUDE_DIRS})
set(__OIIO_IMATH_LIBS ${OPENEXR_LIBRARIES})
endif()
+endif()

pxr_plugin(hioOiio
LIBRARIES
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index 692d045b9..a934c336b 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -22,6 +22,9 @@ find_dependency(TBB CONFIG)

if(@PXR_BUILD_IMAGING@)
find_dependency(OpenSubdiv 3 CONFIG)
+ if(@PXR_BUILD_OPENIMAGEIO_PLUGIN@)
+ find_dependency(OpenImageIO CONFIG)
+ endif()
endif()

# If Python support was enabled for this USD build, find the import
@@ -79,7 +82,7 @@ if(@Imath_FOUND@)
set(Imath_DIR [[@Imath_DIR@]])
endif()
endif()
- find_dependency(Imath)
+ find_dependency(Imath CONFIG)
endif()

include("${PXR_CMAKE_DIR}/cmake/pxrTargets.cmake")
43 changes: 43 additions & 0 deletions ports/usd/005-vcpkg_find_shaderc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index 3763c9997..79679ca13 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -233,6 +233,7 @@ if (PXR_BUILD_IMAGING)
find_package(Vulkan REQUIRED)
list(APPEND VULKAN_LIBS Vulkan::Vulkan)

+ if(0)
# Find the extra vulkan libraries we need
set(EXTRA_VULKAN_LIBS shaderc_combined)
if (WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -242,6 +243,7 @@ if (PXR_BUILD_IMAGING)
find_library("${EXTRA_LIBRARY}_PATH" NAMES "${EXTRA_LIBRARY}" PATHS $ENV{VULKAN_SDK}/lib)
list(APPEND VULKAN_LIBS "${${EXTRA_LIBRARY}_PATH}")
endforeach()
+ endif()

# Find the OS specific libs we need
if (APPLE)
@@ -258,6 +260,8 @@ if (PXR_BUILD_IMAGING)
else()
message(FATAL_ERROR "VULKAN_SDK not valid")
endif()
+ find_package(unofficial-shaderc CONFIG REQUIRED)
+ list(APPEND VULKAN_LIBS unofficial::shaderc::shaderc)
endif()
# --Opensubdiv
find_package(OpenSubdiv 3 CONFIG REQUIRED)
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index a934c336b..62bb13a1b 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -25,6 +25,9 @@ if(@PXR_BUILD_IMAGING@)
if(@PXR_BUILD_OPENIMAGEIO_PLUGIN@)
find_dependency(OpenImageIO CONFIG)
endif()
+ if(@PXR_ENABLE_VULKAN_SUPPORT@)
+ find_dependency(unofficial-shaderc CONFIG)
+ endif()
endif()

# If Python support was enabled for this USD build, find the import
40 changes: 40 additions & 0 deletions ports/usd/006-vcpkg_find_spirv-reflect.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index 79679ca13..d1a8169a2 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -261,7 +261,9 @@ if (PXR_BUILD_IMAGING)
message(FATAL_ERROR "VULKAN_SDK not valid")
endif()
find_package(unofficial-shaderc CONFIG REQUIRED)
+ find_package(unofficial-spirv-reflect CONFIG REQUIRED)
list(APPEND VULKAN_LIBS unofficial::shaderc::shaderc)
+ list(APPEND VULKAN_LIBS unofficial::spirv-reflect)
endif()
# --Opensubdiv
find_package(OpenSubdiv 3 CONFIG REQUIRED)
diff --git a/pxr/imaging/hgiVulkan/CMakeLists.txt b/pxr/imaging/hgiVulkan/CMakeLists.txt
index 97e422894..d13837e45 100644
--- a/pxr/imaging/hgiVulkan/CMakeLists.txt
+++ b/pxr/imaging/hgiVulkan/CMakeLists.txt
@@ -46,9 +46,6 @@ pxr_library(hgiVulkan
api.h
vulkan.h

- PRIVATE_CLASSES
- spirv_reflect
-
RESOURCE_FILES
plugInfo.json
)
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index 62bb13a1b..d5b0d2f77 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -27,6 +27,7 @@ if(@PXR_BUILD_IMAGING@)
endif()
if(@PXR_ENABLE_VULKAN_SUPPORT@)
find_dependency(unofficial-shaderc CONFIG)
+ find_dependency(unofficial-spirv-reflect CONFIG)
endif()
endif()

27 changes: 27 additions & 0 deletions ports/usd/007-vcpkg_find_vma.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
index d1a8169a2..0fb6776a9 100644
--- a/cmake/defaults/Packages.cmake
+++ b/cmake/defaults/Packages.cmake
@@ -262,8 +262,10 @@ if (PXR_BUILD_IMAGING)
endif()
find_package(unofficial-shaderc CONFIG REQUIRED)
find_package(unofficial-spirv-reflect CONFIG REQUIRED)
+ find_package(VulkanMemoryAllocator CONFIG REQUIRED)
list(APPEND VULKAN_LIBS unofficial::shaderc::shaderc)
list(APPEND VULKAN_LIBS unofficial::spirv-reflect)
+ list(APPEND VULKAN_LIBS GPUOpen::VulkanMemoryAllocator)
endif()
# --Opensubdiv
find_package(OpenSubdiv 3 CONFIG REQUIRED)
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index d5b0d2f77..c8039c310 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -28,6 +28,7 @@ if(@PXR_BUILD_IMAGING@)
if(@PXR_ENABLE_VULKAN_SUPPORT@)
find_dependency(unofficial-shaderc CONFIG)
find_dependency(unofficial-spirv-reflect CONFIG)
+ find_dependency(VulkanMemoryAllocator CONFIG)
endif()
endif()

63 changes: 63 additions & 0 deletions ports/usd/008-fix_cmake_package.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
diff --git a/pxr/CMakeLists.txt b/pxr/CMakeLists.txt
index 00cafd3d9..c9faeabf0 100644
--- a/pxr/CMakeLists.txt
+++ b/pxr/CMakeLists.txt
@@ -12,13 +12,31 @@ endif()

pxr_core_epilogue()

-export(PACKAGE pxr)
+include(GNUInstallDirs)
+include(CMakePackageConfigHelpers)

-configure_file(pxrConfig.cmake.in
- "${PROJECT_BINARY_DIR}/pxrConfig.cmake" @ONLY)
-install(FILES
+configure_file(
+ "pxrConfig.cmake.in"
"${PROJECT_BINARY_DIR}/pxrConfig.cmake"
- DESTINATION "${CMAKE_INSTALL_PREFIX}"
+ @ONLY
)

-install(EXPORT pxrTargets DESTINATION "cmake")
+write_basic_package_version_file("${PROJECT_BINARY_DIR}/pxrConfigVersion.cmake"
+ VERSION "${PXR_MAJOR_VERSION}.${PXR_MINOR_VERSION}.${PXR_PATCH_VERSION}"
+ COMPATIBILITY AnyNewerVersion
+)
+
+install(
+ FILES
+ "${PROJECT_BINARY_DIR}/pxrConfig.cmake"
+ "${PROJECT_BINARY_DIR}/pxrConfigVersion.cmake"
+
+ DESTINATION
+ "${CMAKE_INSTALL_DATADIR}/pxr"
+)
+
+install(
+ EXPORT pxrTargets
+ # NAMESPACE "pxr::"
+ DESTINATION "${CMAKE_INSTALL_DATADIR}/pxr"
+)
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index c8039c310..9e104abb7 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -90,14 +90,14 @@ if(@Imath_FOUND@)
find_dependency(Imath CONFIG)
endif()

-include("${PXR_CMAKE_DIR}/cmake/pxrTargets.cmake")
+include("${PXR_CMAKE_DIR}/pxrTargets.cmake")
if (TARGET usd_ms)
set(libs "usd_ms")
else()
set(libs "@PXR_ALL_LIBS@")
endif()
set(PXR_LIBRARIES "")
-set(PXR_INCLUDE_DIRS "${PXR_CMAKE_DIR}/include")
+set(PXR_INCLUDE_DIRS "${PXR_CMAKE_DIR}/../../include")
string(REPLACE " " ";" libs "${libs}")
foreach(lib ${libs})
get_target_property(location ${lib} LOCATION)
23 changes: 23 additions & 0 deletions ports/usd/009-fix_cmake_hgi_interop.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/pxr/imaging/hgiInterop/CMakeLists.txt b/pxr/imaging/hgiInterop/CMakeLists.txt
index 64ebfcb9e..0087d89aa 100644
--- a/pxr/imaging/hgiInterop/CMakeLists.txt
+++ b/pxr/imaging/hgiInterop/CMakeLists.txt
@@ -15,6 +15,7 @@ set(optionalPrivateHeaders "")
list(APPEND optionalLibraries garch)

if (PXR_ENABLE_GL_SUPPORT)
+ list(APPEND optionalLibraries hgiGL)
list(APPEND optionalCppFiles opengl.cpp)
list(APPEND optionalPrivateHeaders opengl.h)
endif()
@@ -32,6 +33,10 @@ if (PXR_ENABLE_METAL_SUPPORT)
list(APPEND optionalPrivateHeaders metal.h)
endif()

+if (NOT (PXR_ENABLE_GL_SUPPORT OR PXR_ENABLE_VULKAN_SUPPORT OR PXR_ENABLE_METAL_SUPPORT))
+ message(FATAL_ERROR "No valid GPU backend set for hgiInterop")
+endif()
+
pxr_library(hgiInterop
LIBRARIES
gf
17 changes: 17 additions & 0 deletions ports/usd/010-fix_missing_find_dependency_vulkan.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
index 9e104abb7..2aa4a3bd3 100644
--- a/pxr/pxrConfig.cmake.in
+++ b/pxr/pxrConfig.cmake.in
@@ -26,6 +26,12 @@ if(@PXR_BUILD_IMAGING@)
find_dependency(OpenImageIO CONFIG)
endif()
if(@PXR_ENABLE_VULKAN_SUPPORT@)
+ if (NOT DEFINED Vulkan_DIR)
+ if (NOT [[@Vulkan_DIR@]] STREQUAL "")
+ set(Vulkan_DIR [[@Vulkan_DIR@]])
+ endif()
+ endif()
+ find_dependency(Vulkan REQUIRED)
find_dependency(unofficial-shaderc CONFIG)
find_dependency(unofficial-spirv-reflect CONFIG)
find_dependency(VulkanMemoryAllocator CONFIG)
Loading

0 comments on commit 4fb6441

Please sign in to comment.