mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 01:30:55 +08:00
[usd] update to 24.11 (#41864)
This commit is contained in:
parent
8e78590ad7
commit
6de717b75b
139
ports/usd/003-fix-dep.patch
Normal file
139
ports/usd/003-fix-dep.patch
Normal file
@ -0,0 +1,139 @@
|
||||
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
|
||||
index 1b69cad..9494278 100644
|
||||
--- a/cmake/defaults/Packages.cmake
|
||||
+++ b/cmake/defaults/Packages.cmake
|
||||
@@ -190,7 +190,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")
|
||||
@@ -227,6 +228,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")
|
||||
@@ -236,6 +238,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 (UNIX AND NOT APPLE)
|
||||
@@ -249,10 +252,20 @@ if (PXR_BUILD_IMAGING)
|
||||
else()
|
||||
message(FATAL_ERROR "VULKAN_SDK not valid")
|
||||
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
|
||||
- set(OPENSUBDIV_USE_GPU ${PXR_BUILD_GPU_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/imaging/hgiVulkan/CMakeLists.txt b/pxr/imaging/hgiVulkan/CMakeLists.txt
|
||||
index 97e4228..3eb83be 100644
|
||||
--- a/pxr/imaging/hgiVulkan/CMakeLists.txt
|
||||
+++ b/pxr/imaging/hgiVulkan/CMakeLists.txt
|
||||
@@ -46,8 +46,6 @@ pxr_library(hgiVulkan
|
||||
api.h
|
||||
vulkan.h
|
||||
|
||||
- PRIVATE_CLASSES
|
||||
- spirv_reflect
|
||||
|
||||
RESOURCE_FILES
|
||||
plugInfo.json
|
||||
diff --git a/pxr/imaging/plugin/hioOiio/CMakeLists.txt b/pxr/imaging/plugin/hioOiio/CMakeLists.txt
|
||||
index 0a055b7..de4b73a 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 041cd8c..2f89d69 100644
|
||||
--- a/pxr/pxrConfig.cmake.in
|
||||
+++ b/pxr/pxrConfig.cmake.in
|
||||
@@ -20,6 +20,27 @@ include(CMakeFindDependencyMacro)
|
||||
|
||||
find_dependency(TBB CONFIG)
|
||||
|
||||
+if(@PXR_BUILD_IMAGING@)
|
||||
+ find_dependency(OpenSubdiv 3 CONFIG)
|
||||
+ if(@PXR_BUILD_OPENIMAGEIO_PLUGIN@)
|
||||
+ find_dependency(OpenImageIO CONFIG)
|
||||
+ endif()
|
||||
+ if(@PXR_ENABLE_GL_SUPPORT@)
|
||||
+ find_dependency(OpenGL REQUIRED)
|
||||
+ 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)
|
||||
+ endif()
|
||||
+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
|
||||
@@ -75,17 +96,17 @@ 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")
|
||||
+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)
|
@ -1,34 +0,0 @@
|
||||
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
|
@ -1,8 +1,8 @@
|
||||
diff --git a/pxr/CMakeLists.txt b/pxr/CMakeLists.txt
|
||||
index 00cafd3d9..c9faeabf0 100644
|
||||
index 4c7301b..94d2f2a 100644
|
||||
--- a/pxr/CMakeLists.txt
|
||||
+++ b/pxr/CMakeLists.txt
|
||||
@@ -12,13 +12,31 @@ endif()
|
||||
@@ -17,13 +17,31 @@ endif()
|
||||
|
||||
pxr_core_epilogue()
|
||||
|
||||
@ -40,24 +40,3 @@ index 00cafd3d9..c9faeabf0 100644
|
||||
+ # 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)
|
@ -1,57 +0,0 @@
|
||||
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")
|
@ -1,8 +1,17 @@
|
||||
diff --git a/pxr/imaging/hdSt/materialXFilter.cpp b/pxr/imaging/hdSt/materialXFilter.cpp
|
||||
index 8897c5e72..975017525 100644
|
||||
index 4a3977e..0dc43a3 100644
|
||||
--- a/pxr/imaging/hdSt/materialXFilter.cpp
|
||||
+++ b/pxr/imaging/hdSt/materialXFilter.cpp
|
||||
@@ -634,26 +634,48 @@ _GetGlTFSurfaceMaterialTag(HdMaterialNode2 const& terminal)
|
||||
@@ -510,7 +510,7 @@ _UpdatePrimvarNodes(
|
||||
texCoordName = metadata[SdrNodeMetadata->Primvars];
|
||||
}
|
||||
|
||||
- (*mxHdPrimvarMap)[texCoordName] = mx::Type::VECTOR2->getName();
|
||||
+ (*mxHdPrimvarMap)[texCoordName] = mx::Type::VECTOR2.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -628,26 +628,47 @@ _GetGlTFSurfaceMaterialTag(HdMaterialNode2 const& terminal)
|
||||
return materialToken.GetString();
|
||||
}
|
||||
|
||||
@ -10,7 +19,7 @@ index 8897c5e72..975017525 100644
|
||||
+static const mx::TypeDesc
|
||||
_GetMxTypeDescription(std::string const& typeName)
|
||||
{
|
||||
+#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
|
||||
+ #if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
|
||||
+ // Add whatever is necessary for current codebase:
|
||||
+ static const auto _typeLibrary =
|
||||
+ std::map<std::string, const mx::TypeDesc*>{
|
||||
@ -56,13 +65,12 @@ index 8897c5e72..975017525 100644
|
||||
return typeDescIt->second;
|
||||
}
|
||||
- return nullptr;
|
||||
+
|
||||
+ return mx::Type::NONE;
|
||||
+#endif
|
||||
}
|
||||
|
||||
// This function adds a stripped down version of the surfaceshader node to the
|
||||
@@ -678,32 +700,30 @@ _AddStrippedSurfaceNode(
|
||||
@@ -672,32 +693,30 @@ _AddStrippedSurfaceNode(
|
||||
if (!mxInputDef) {
|
||||
continue;
|
||||
}
|
||||
@ -83,7 +91,7 @@ index 8897c5e72..975017525 100644
|
||||
_AddStrippedSurfaceNode(mxDocument, hdConnectedPath.GetName(),
|
||||
hdConnectedNode, hdNetwork);
|
||||
- mx::InputPtr mxInput =
|
||||
- mxNode->addInput(mxInput->getName(), mxInput->getType());
|
||||
- mxNode->addInput(mxInputDef->getName(), mxInputDef->getType());
|
||||
+ mx::InputPtr mxInput = mxNode->addInputFromNodeDef(mxInputDef->getName());
|
||||
mxInput->setConnectedNode(mxConnectedNode);
|
||||
}
|
||||
@ -103,7 +111,7 @@ index 8897c5e72..975017525 100644
|
||||
mxInput->setValueString(valueStr);
|
||||
}
|
||||
}
|
||||
@@ -715,16 +735,15 @@ _AddStrippedSurfaceNode(
|
||||
@@ -709,16 +728,15 @@ _AddStrippedSurfaceNode(
|
||||
if (!mxInputDef) {
|
||||
continue;
|
||||
}
|
||||
@ -125,19 +133,19 @@ index 8897c5e72..975017525 100644
|
||||
mxInput->setValueString(HdMtlxConvertToString(paramIt.second));
|
||||
}
|
||||
}
|
||||
@@ -787,9 +806,9 @@ _GetMaterialTag(
|
||||
@@ -781,9 +799,9 @@ _GetMaterialTag(
|
||||
// Outputting anything that is not a surfaceshader will be
|
||||
// considered opaque, unless outputting a color4 or vector4.
|
||||
// XXX This is not fully per USD specs, but is supported by MaterialX.
|
||||
- auto const* typeDesc =
|
||||
+ auto const typeDesc =
|
||||
+ auto const typeDesc =
|
||||
_GetMxTypeDescription(activeOutputs.back()->getType());
|
||||
- if (typeDesc == mx::Type::COLOR4 || typeDesc == mx::Type::VECTOR4) {
|
||||
+ if (typeDesc.isFloat4()) {
|
||||
+ if (typeDesc.isFloat4()) {
|
||||
return HdStMaterialTagTokens->translucent.GetString();
|
||||
}
|
||||
return HdStMaterialTagTokens->defaultMaterialTag.GetString();
|
||||
@@ -1100,7 +1119,7 @@ _AddMaterialXParams(
|
||||
@@ -1094,7 +1112,7 @@ _AddMaterialXParams(
|
||||
|
||||
// MaterialX parameter Information
|
||||
const auto* variable = paramsBlock[i];
|
||||
@ -146,7 +154,7 @@ index 8897c5e72..975017525 100644
|
||||
|
||||
// Create a corresponding HdSt_MaterialParam
|
||||
HdSt_MaterialParam param;
|
||||
@@ -1111,9 +1130,9 @@ _AddMaterialXParams(
|
||||
@@ -1105,9 +1123,9 @@ _AddMaterialXParams(
|
||||
const auto paramValueIt =
|
||||
mxParamNameToValue.find(variable->getVariable());
|
||||
if (paramValueIt != mxParamNameToValue.end()) {
|
||||
@ -159,7 +167,7 @@ index 8897c5e72..975017525 100644
|
||||
param.fallbackValue = paramValueIt->second;
|
||||
}
|
||||
}
|
||||
@@ -1124,52 +1143,52 @@ _AddMaterialXParams(
|
||||
@@ -1118,52 +1136,52 @@ _AddMaterialXParams(
|
||||
const auto varValue = variable->getValue();
|
||||
std::istringstream valueStream(varValue
|
||||
? varValue->getValueString() : std::string());
|
||||
@ -223,7 +231,7 @@ index 8897c5e72..975017525 100644
|
||||
GfVec4i val;
|
||||
valueStream >> val[0] >> separator >> val[1] >> separator
|
||||
>> val[2] >> separator >> val[3];
|
||||
@@ -1183,7 +1202,7 @@ _AddMaterialXParams(
|
||||
@@ -1177,7 +1195,7 @@ _AddMaterialXParams(
|
||||
}
|
||||
|
||||
// For filename inputs, manage the associated texture node
|
||||
@ -233,17 +241,17 @@ index 8897c5e72..975017525 100644
|
||||
// annonNodeName_paramName -> annonNodeName
|
||||
std::string mxNodeName = variable->getVariable();
|
||||
diff --git a/pxr/imaging/hdSt/materialXShaderGen.cpp b/pxr/imaging/hdSt/materialXShaderGen.cpp
|
||||
index 30674b521..78517b39d 100644
|
||||
index 136b096..8ba27b2 100644
|
||||
--- a/pxr/imaging/hdSt/materialXShaderGen.cpp
|
||||
+++ b/pxr/imaging/hdSt/materialXShaderGen.cpp
|
||||
@@ -156,13 +156,17 @@ HdStMaterialXShaderGen<Base>::_EmitGlslfxHeader(mx::ShaderStage& mxStage) const
|
||||
@@ -158,13 +158,17 @@ HdStMaterialXShaderGen<Base>::_EmitGlslfxHeader(mx::ShaderStage& mxStage) const
|
||||
Base::emitString(R"( "attributes": {)" "\n", mxStage);
|
||||
std::string line = ""; unsigned int i = 0;
|
||||
for (mx::StringMap::const_reference primvarPair : _mxHdPrimvarMap) {
|
||||
- const mx::TypeDesc *mxType = mx::TypeDesc::get(primvarPair.second);
|
||||
- if (mxType == nullptr) {
|
||||
+ const mx::TypeDesc mxType = getMxTypeDesc(primvarPair.second);
|
||||
+ if (mxTypeIsNone(mxType)) {
|
||||
+ if (mxTypeIsNone(mxType)) {
|
||||
TF_WARN("MaterialX geomprop '%s' has unknown type '%s'",
|
||||
primvarPair.first.c_str(), primvarPair.second.c_str());
|
||||
}
|
||||
@ -258,7 +266,7 @@ index 30674b521..78517b39d 100644
|
||||
|
||||
line += " \"" + primvarPair.first + "\": {\n";
|
||||
line += " \"type\": \"" + type + "\"\n";
|
||||
@@ -285,12 +289,15 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
@@ -287,12 +291,15 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
if (outputConnection) {
|
||||
|
||||
std::string finalOutput = outputConnection->getVariable();
|
||||
@ -274,7 +282,7 @@ index 30674b521..78517b39d 100644
|
||||
|
||||
if (mxGraph.hasClassification(
|
||||
mx::ShaderNode::Classification::SURFACE)) {
|
||||
@@ -311,7 +318,7 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
@@ -313,7 +320,7 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -283,7 +291,7 @@ index 30674b521..78517b39d 100644
|
||||
Base::toVec4(outputSocket->getType(), finalOutput);
|
||||
}
|
||||
emitLine(finalOutputReturn +
|
||||
@@ -323,7 +330,7 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
@@ -325,7 +332,7 @@ HdStMaterialXShaderGen<Base>::_EmitMxSurfaceShader(
|
||||
? Base::_syntax->getValue(
|
||||
outputSocket->getType(), *outputSocket->getValue())
|
||||
: Base::_syntax->getDefaultValue(outputSocket->getType());
|
||||
@ -292,7 +300,7 @@ index 30674b521..78517b39d 100644
|
||||
std::string finalOutput = outputSocket->getVariable() + "_tmp";
|
||||
emitLine(Base::_syntax->getTypeName(outputSocket->getType())
|
||||
+ " " + finalOutput + " = " + outputValue, mxStage);
|
||||
@@ -415,8 +422,8 @@ HdStMaterialXShaderGen<Base>::_EmitMxInitFunction(
|
||||
@@ -417,8 +424,8 @@ HdStMaterialXShaderGen<Base>::_EmitMxInitFunction(
|
||||
mxStage.getUniformBlock(mx::HW::PUBLIC_UNIFORMS);
|
||||
for (size_t i = 0; i < paramsBlock.size(); ++i) {
|
||||
const mx::ShaderPort* variable = paramsBlock[i];
|
||||
@ -303,7 +311,7 @@ index 30674b521..78517b39d 100644
|
||||
emitLine(variable->getVariable() + " = HdGet_" +
|
||||
variable->getVariable() + "()", mxStage);
|
||||
}
|
||||
@@ -622,16 +629,16 @@ HdStMaterialXShaderGen<Base>::emitVariableDeclarations(
|
||||
@@ -624,16 +631,16 @@ HdStMaterialXShaderGen<Base>::emitVariableDeclarations(
|
||||
{
|
||||
Base::emitLineBegin(stage);
|
||||
const mx::ShaderPort* variable = block[i];
|
||||
@ -323,10 +331,10 @@ index 30674b521..78517b39d 100644
|
||||
|| MxHdVariables.count(variable->getName()) ) {
|
||||
Base::emitVariableDeclaration(variable, mx::EMPTY_STRING,
|
||||
context, stage, false /* assignValue */);
|
||||
@@ -1349,4 +1356,53 @@ HdStMaterialXShaderGenMsl::_EmitMxFunctions(
|
||||
@@ -1351,6 +1358,53 @@ HdStMaterialXShaderGenMsl::_EmitMxFunctions(
|
||||
_EmitDataStructsAndFunctionDefinitions(
|
||||
mxGraph, mxContext, mxStage, &_tokenSubstitutions);
|
||||
}
|
||||
|
||||
|
||||
+bool mxTypeIsNone(mx::TypeDesc typeDesc)
|
||||
+{
|
||||
+#if MATERIALX_MAJOR_VERSION == 1 && MATERIALX_MINOR_VERSION==38
|
||||
@ -374,11 +382,11 @@ index 30674b521..78517b39d 100644
|
||||
+ return port->getType();
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
+
|
||||
|
||||
|
||||
PXR_NAMESPACE_CLOSE_SCOPE
|
||||
diff --git a/pxr/imaging/hdSt/materialXShaderGen.h b/pxr/imaging/hdSt/materialXShaderGen.h
|
||||
index e61bd13a4..a7f93fdd0 100644
|
||||
index e61bd13..a7f93fd 100644
|
||||
--- a/pxr/imaging/hdSt/materialXShaderGen.h
|
||||
+++ b/pxr/imaging/hdSt/materialXShaderGen.h
|
||||
@@ -192,6 +192,13 @@ private:
|
@ -1,43 +0,0 @@
|
||||
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
|
@ -1,40 +0,0 @@
|
||||
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()
|
||||
|
@ -1,27 +0,0 @@
|
||||
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()
|
||||
|
@ -1,17 +0,0 @@
|
||||
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)
|
28
ports/usd/012-fix-find-vulkan.patch
Normal file
28
ports/usd/012-fix-find-vulkan.patch
Normal file
@ -0,0 +1,28 @@
|
||||
diff --git a/cmake/defaults/Packages.cmake b/cmake/defaults/Packages.cmake
|
||||
index 9494278..473bb62 100644
|
||||
--- a/cmake/defaults/Packages.cmake
|
||||
+++ b/cmake/defaults/Packages.cmake
|
||||
@@ -218,13 +218,6 @@ if (PXR_BUILD_IMAGING)
|
||||
endif()
|
||||
if (PXR_ENABLE_VULKAN_SUPPORT)
|
||||
message(STATUS "Enabling experimental feature Vulkan support")
|
||||
- if (EXISTS $ENV{VULKAN_SDK})
|
||||
- # Prioritize the VULKAN_SDK includes and packages before any system
|
||||
- # installed headers. This is to prevent linking against older SDKs
|
||||
- # that may be installed by the OS.
|
||||
- # XXX This is fixed in cmake 3.18+
|
||||
- include_directories(BEFORE SYSTEM $ENV{VULKAN_SDK} $ENV{VULKAN_SDK}/include $ENV{VULKAN_SDK}/lib $ENV{VULKAN_SDK}/source)
|
||||
- set(ENV{PATH} "$ENV{VULKAN_SDK}:$ENV{VULKAN_SDK}/include:$ENV{VULKAN_SDK}/lib:$ENV{VULKAN_SDK}/source:$ENV{PATH}")
|
||||
find_package(Vulkan REQUIRED)
|
||||
list(APPEND VULKAN_LIBS Vulkan::Vulkan)
|
||||
|
||||
@@ -249,9 +242,6 @@ if (PXR_BUILD_IMAGING)
|
||||
endif()
|
||||
|
||||
add_definitions(-DPXR_VULKAN_SUPPORT_ENABLED)
|
||||
- else()
|
||||
- message(FATAL_ERROR "VULKAN_SDK not valid")
|
||||
- endif()
|
||||
find_package(unofficial-shaderc CONFIG REQUIRED)
|
||||
find_package(unofficial-spirv-reflect CONFIG REQUIRED)
|
||||
find_package(VulkanMemoryAllocator CONFIG REQUIRED)
|
@ -1,14 +0,0 @@
|
||||
diff --git a/pxr/pxrConfig.cmake.in b/pxr/pxrConfig.cmake.in
|
||||
index 2aa4a3bd3..2f89d690c 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_GL_SUPPORT@)
|
||||
+ find_dependency(OpenGL REQUIRED)
|
||||
+ endif()
|
||||
if(@PXR_ENABLE_VULKAN_SUPPORT@)
|
||||
if (NOT DEFINED Vulkan_DIR)
|
||||
if (NOT [[@Vulkan_DIR@]] STREQUAL "")
|
@ -6,29 +6,30 @@ vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
||||
|
||||
string(REGEX REPLACE "^([0-9]+)[.]([0-9])\$" "\\1.0\\2" USD_VERSION "${VERSION}")
|
||||
|
||||
vcpkg_download_distfile(MSVC_PATCH
|
||||
URLS https://github.com/PixarAnimationStudios/OpenUSD/commit/b677b238ba596f31f252d38dd5172d3e869d193e.patch?full_index=1
|
||||
FILENAME fix-msvc.patch
|
||||
SHA512 1dc8e6559d322f861fd0f0673679358cbc259ddf0ac4cf3a1306557ee8a4a9fdd362d57101b30bb9367abf889e13bbcba6b40fbb571c07899c5b5a8431adcb74
|
||||
)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO PixarAnimationStudios/OpenUSD
|
||||
REF "v${USD_VERSION}"
|
||||
SHA512 7d4404980579c4de3c155386184ca9d2eb96756ef6e090611bae7b4c21ad942c649f73a39b74ad84d0151ce6b9236c4b6c0c555e8e36fdd86304079e1c2e5cbe
|
||||
SHA512 77c9601f4a689248448049660ef0083fc99e2a4c2e7a260814831bdfee8e9844f64b5b2aed88a9f907fe4ebcf6a532bb7dce80bb11c1f54c31066b07aa96b851
|
||||
HEAD_REF release
|
||||
PATCHES
|
||||
001-fix_rename_find_package_to_find_dependency.patch # See PixarAnimationStudios/OpenUSD#3205
|
||||
002-vcpkg_find_tbb.patch # See PixarAnimationStudios/OpenUSD#3207
|
||||
003-vcpkg_find_opensubdiv.patch
|
||||
004-vcpkg_find_openimageio.patch
|
||||
005-vcpkg_find_shaderc.patch
|
||||
006-vcpkg_find_spirv-reflect.patch
|
||||
007-vcpkg_find_vma.patch
|
||||
008-fix_cmake_package.patch
|
||||
009-fix_cmake_hgi_interop.patch
|
||||
010-fix_missing_find_dependency_vulkan.patch
|
||||
011-fix_clang8_compiler_error.patch
|
||||
012-vcpkg_install_folder_conventions.patch
|
||||
013-cmake_export_plugin_as_modules.patch
|
||||
014-MaterialX_v1.38-39.patch # PixarAnimationStudios/OpenUSD#3159
|
||||
015-fix_missing_find_dependency_opengl.patch
|
||||
016-TBB-2022.patch # Accomodate oneapi-src/oneTBB#1345 changes
|
||||
003-fix-dep.patch
|
||||
004-fix_cmake_package.patch
|
||||
005-MaterialX_v1.38-39.patch
|
||||
"${MSVC_PATCH}"
|
||||
007-fix_cmake_hgi_interop.patch
|
||||
008-fix_clang8_compiler_error.patch
|
||||
009-vcpkg_install_folder_conventions.patch
|
||||
010-cmake_export_plugin_as_modules.patch
|
||||
011-TBB-2022.patch
|
||||
012-fix-find-vulkan.patch
|
||||
)
|
||||
|
||||
# Changes accompanying 006-vcpkg_find_spirv-reflect.patch
|
||||
|
@ -1,7 +1,6 @@
|
||||
{
|
||||
"name": "usd",
|
||||
"version": "24.8",
|
||||
"port-version": 1,
|
||||
"version": "24.11",
|
||||
"description": "Universal Scene Description (USD) is an efficient, scalable system for authoring, reading, and streaming time-sampled scene description for interchange between graphics applications.",
|
||||
"homepage": "https://github.com/PixarAnimationStudios/USD",
|
||||
"license": null,
|
||||
|
@ -9265,8 +9265,8 @@
|
||||
"port-version": 1
|
||||
},
|
||||
"usd": {
|
||||
"baseline": "24.8",
|
||||
"port-version": 1
|
||||
"baseline": "24.11",
|
||||
"port-version": 0
|
||||
},
|
||||
"usearch": {
|
||||
"baseline": "2.3.2",
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "a96dae4b6c9e6d254b6601fb1be2c0088881a0b4",
|
||||
"version": "24.11",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "5d916134edd638a11c6a73e8553896d837d26f2b",
|
||||
"version": "24.8",
|
||||
|
Loading…
x
Reference in New Issue
Block a user