From 4d30c2fc8bab8b621729b4e72f6a7ab581d8edcc Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 13 Sep 2024 17:15:27 -0400 Subject: [PATCH 1/7] SConstruct : Update Windows compiler to MSVC 17.8 This updates to a Visual Studio 2022 series compiler, which has a runtime library of 14.3, which is what SCons uses to choose the toolset. --- Changes.md | 1 + SConstruct | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changes.md b/Changes.md index 7f6af311ea..8fae9a8135 100644 --- a/Changes.md +++ b/Changes.md @@ -117,6 +117,7 @@ Build - Qt : Updated to version 5.15.14. - USD : Updated to version 24.08. - Zstandard : Added version 1.5.0. +- Windows : Update compiler to Visual Studio 2022 / MSVC 17.8 / Runtime library 14.3. 1.4.x.x (relative to 1.4.12.0) ======= diff --git a/SConstruct b/SConstruct index 39ea0d77c2..09f9b1f50f 100644 --- a/SConstruct +++ b/SConstruct @@ -377,7 +377,7 @@ options.Add( "GAFFER_VERSION_SUFFIX", "Version suffix", str( gafferVersionSuffix env = Environment( - MSVC_VERSION = "14.2", + MSVC_VERSION = "14.3", options = options, @@ -588,6 +588,8 @@ else: "/wd4003", # suppress warning "not enough arguments for function-like macro invocation 'BOOST_PP_SEQ_DETAIL_IS_NOT_EMPTY'". Needed for USD. "/wd4702", # suppress warning "unreachable code". Need for OpenVDB. "/wd4180", # suppress warning "qualifier applied to function type has no meaning; ignored". Needed for OpenVDB + "/wd4146", # suppress warning "unary minus operator applied to unsigned type, result still unsigned" (from Cryptomatte::MurmurHash3_x86_32()) + "/D_CRT_NONSTDC_NO_WARNINGS", # suppress warnings about deprecated POSIX names. The names are deprecated, not the functions, so this is safe. ], ) From 042f6ef0f65e96ed28ea6b59e14cde8e10bebb4b Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 13 Sep 2024 17:18:56 -0400 Subject: [PATCH 2/7] SConstruct : Dependencies 9.x Cycles Windows --- SConstruct | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SConstruct b/SConstruct index 09f9b1f50f..4ad476aab3 100644 --- a/SConstruct +++ b/SConstruct @@ -1289,7 +1289,7 @@ libraries = { "Gaffer", "GafferScene", "GafferDispatch", "GafferOSL" ] + cyclesLibraries + [ "OpenImageIO$OIIO_LIB_SUFFIX", "OpenImageIO_Util$OIIO_LIB_SUFFIX", "oslexec$OSL_LIB_SUFFIX", "oslquery$OSL_LIB_SUFFIX", - "openvdb$VDB_LIB_SUFFIX", "Alembic", "osdCPU", "OpenColorIO$OCIO_LIB_SUFFIX", "embree4", "Iex", "openpgl", + "openvdb$VDB_LIB_SUFFIX", "Alembic", "osdCPU", "OpenColorIO$OCIO_LIB_SUFFIX", "embree4", "Iex", "openpgl", "zstd", ], "CXXFLAGS" : [ systemIncludeArgument, "$CYCLES_ROOT/include" ], "CPPDEFINES" : cyclesDefines, @@ -1301,7 +1301,7 @@ libraries = { "Gaffer", "GafferScene", "GafferDispatch", "GafferBindings", "GafferCycles", "IECoreScene", ] + ( cyclesLibraries if includeCyclesLibrariesInPythonModule else [] ) + [ "OpenImageIO$OIIO_LIB_SUFFIX", "OpenImageIO_Util$OIIO_LIB_SUFFIX", "oslexec$OSL_LIB_SUFFIX", "openvdb$VDB_LIB_SUFFIX", - "oslquery$OSL_LIB_SUFFIX", "Alembic", "osdCPU", "OpenColorIO$OCIO_LIB_SUFFIX", "embree4", "Iex", "openpgl", + "oslquery$OSL_LIB_SUFFIX", "Alembic", "osdCPU", "OpenColorIO$OCIO_LIB_SUFFIX", "embree4", "Iex", "openpgl", "zstd", ], "CXXFLAGS" : [ systemIncludeArgument, "$CYCLES_ROOT/include" ], "CPPDEFINES" : cyclesDefines, @@ -1454,7 +1454,7 @@ if env["PLATFORM"] == "win32" : else : - libraries["GafferCycles"]["envAppends"]["LIBS"].extend( [ "dl", "zstd" ] ) + libraries["GafferCycles"]["envAppends"]["LIBS"].extend( [ "dl" ] ) # Optionally add vTune requirements From e3f7c18fd5036857392cb23ea4deb64840473f61 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 13 Sep 2024 17:20:06 -0400 Subject: [PATCH 3/7] CI : Windows dependencies 9.0.0a2 --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6480d59809..7930d2f7f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -69,7 +69,6 @@ jobs: testArguments: -excludedCategories performance GafferTest GafferVDBTest GafferUSDTest GafferSceneTest GafferDispatchTest GafferOSLTest GafferImageTest GafferUITest GafferImageUITest GafferSceneUITest GafferDispatchUITest GafferOSLUITest GafferUSDUITest GafferVDBUITest GafferDelightUITest GafferTractorTest GafferTractorUITest sconsCacheMegabytes: 800 jobs: 4 - dependenciesURL: https://github.com/ImageEngine/cortex/releases/download/10.5.9.2/cortex-10.5.9.2-windows.zip runs-on: ${{ matrix.os }} From c145aa6f04f706267ffda844f3f62302b216d865 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 13 Sep 2024 17:20:44 -0400 Subject: [PATCH 4/7] USD : Indicate support for Windows `usdview`. This is a result of a fix in the dependencies, but noted here for better visibility to users. Fixes #5599 --- Changes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Changes.md b/Changes.md index 8fae9a8135..4cc5d74714 100644 --- a/Changes.md +++ b/Changes.md @@ -46,6 +46,7 @@ Fixes - Fixed thread-safety bug. - HierarchyView, SetEditor : Fixed thread-safety bugs. - FreezeTransform : Constant primitive variables with point/vector interpretations are now also transformed. +- usdview : Added Windows support (#5599). API --- From 3bf58b19bcf56445adf6c4e77737b86b3ecc2b2f Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Fri, 13 Sep 2024 17:36:16 -0400 Subject: [PATCH 5/7] CI : Update Windows build runner and Windows SDK --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7930d2f7f6..768795a5de 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,7 +61,7 @@ jobs: jobs: 4 - name: windows - os: windows-2019 + os: windows-2022 buildType: RELEASE publish: true containerImage: @@ -86,7 +86,7 @@ jobs: - uses: ilammy/msvc-dev-cmd@v1.13.0 with: - sdk: 10.0.17763.0 + sdk: 10.0.19041.0 - name: Install toolchain (Windows) run: | From eed4deee1b81ea4395f263bb54a5b9d156cde00a Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Mon, 16 Sep 2024 09:58:05 -0400 Subject: [PATCH 6/7] MonitorAlgo : Update deprecated `std::result_of_t` This was deprecated in c++17 and removed in c++20, in favor of `std::invoke_result_t`, which we use here. --- src/Gaffer/MonitorAlgo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Gaffer/MonitorAlgo.cpp b/src/Gaffer/MonitorAlgo.cpp index 43e12111e2..343166d57b 100644 --- a/src/Gaffer/MonitorAlgo.cpp +++ b/src/Gaffer/MonitorAlgo.cpp @@ -206,7 +206,7 @@ struct HashesPerComputeMetric // Utility for invoking a templated functor with a particular metric. template -std::result_of_t dispatchMetric( const F &f, MonitorAlgo::PerformanceMetric performanceMetric ) +std::invoke_result_t dispatchMetric( const F &f, MonitorAlgo::PerformanceMetric performanceMetric ) { switch( performanceMetric ) { From f7d04a461e947d85dbb58e1b32700cbaa4dc2173 Mon Sep 17 00:00:00 2001 From: Eric Mehl Date: Mon, 16 Sep 2024 10:00:49 -0400 Subject: [PATCH 7/7] Renderer : Avoid deprecated `shared_ptr::unique()` This was deprecated in c++17 and removed in c++20 because it gives potentially incorrect results in a multithreaded environment. All of our uses are noted as not being able to be called by multiple threads, so the comparison `use_count() == 1` is valid. --- src/GafferCycles/IECoreCyclesPreview/Renderer.cpp | 4 ++-- src/IECoreArnold/Renderer.cpp | 2 +- src/IECoreDelight/Renderer.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp index a94fed31d1..988e16a4ab 100644 --- a/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp +++ b/src/GafferCycles/IECoreCyclesPreview/Renderer.cpp @@ -1571,7 +1571,7 @@ class InstanceCache : public IECore::RefCounted for( Geometry::iterator it = m_geometry.begin(), eIt = m_geometry.end(); it != eIt; ++it ) { - if( it->second.unique() ) + if( it->second.use_count() == 1 ) { // Only one reference - this is ours, so // nothing outside of the cache is using the @@ -1846,7 +1846,7 @@ class CameraCache : public IECore::RefCounted vector toErase; for( Cache::iterator it = m_cache.begin(), eIt = m_cache.end(); it != eIt; ++it ) { - if( it->second.unique() ) + if( it->second.use_count() == 1 ) { // Only one reference - this is ours, so // nothing outside of the cache is using the diff --git a/src/IECoreArnold/Renderer.cpp b/src/IECoreArnold/Renderer.cpp index 1cd939d19c..7c24dee9c9 100644 --- a/src/IECoreArnold/Renderer.cpp +++ b/src/IECoreArnold/Renderer.cpp @@ -2276,7 +2276,7 @@ class InstanceCache : public IECore::RefCounted vector toErase; for( Cache::iterator it = m_cache.begin(), eIt = m_cache.end(); it != eIt; ++it ) { - if( it->second.unique() ) + if( it->second.use_count() == 1 ) { // Only one reference - this is ours, so // nothing outside of the cache is using the diff --git a/src/IECoreDelight/Renderer.cpp b/src/IECoreDelight/Renderer.cpp index bc5cb596c9..5456b8ca2e 100644 --- a/src/IECoreDelight/Renderer.cpp +++ b/src/IECoreDelight/Renderer.cpp @@ -970,7 +970,7 @@ class InstanceCache : public IECore::RefCounted vector toErase; for( Cache::iterator it = m_cache.begin(), eIt = m_cache.end(); it != eIt; ++it ) { - if( it->second.unique() ) + if( it->second.use_count() == 1 ) { // Only one reference - this is ours, so // nothing outside of the cache is using the