Skip to content

Commit 6918fad

Browse files
doug-walkeranthony-linaroDevTGHaMorteezacozdas
authored
Create the 2.4.2 release (#2131)
* Add support for Windows ARM64 (#2089) * Add support for Windows ARM64 Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Fix improper compiler flag check Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Fix sse2neon issues on Windows ARM64 Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Fix cross-compilation on Windows for X64 -> ARM64 Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Fix comment to match with corresponding if directive Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Check for MSVC before setting MSVC-style flag Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> * Fix comment to resolve ambiguity Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> --------- Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit c09951e) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Fix issue with ocio_depts handling spaces in file paths (#2109) Signed-off-by: Taegyun Ha <taegyun.ha@disguise.one> (cherry picked from commit c5c85b0) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Issue #2116 : Fixes Metal backend's generated shaders with float/int constant Array Performance (#2117) * Issue #2116 : Improves Metal Backend Perf. moves the constant float/int declaration to constant space so it doesnt get initialized per thread. This improved color correction performance on M4 Max 3-4 times better. Signed-off-by: Morteza <smostajabodaveh@apple.com> * Tiny refactoring to improve code maintainability Signed-off-by: Morteza <smostajabodaveh@apple.com> --------- Signed-off-by: Morteza <smostajabodaveh@apple.com> (cherry picked from commit d807b38) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Adsk Contrib - Issue #2111 Absolute paths not working through proxy (#2112) * Ticket #2111 - Do not use config proxy for absolute paths while computing file hash or loading LUT data. - Added the unit test provided in the ticket. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - Changing the logic so that for abs paths we first try the configProxy and if that fails fall back to file system. For relative paths, we don't fall back to file system though, proxy is expected to handle those. - Removed the unnecessary closeLutStream() function. We're using unique pointers, that means RAII is in place. The whole idea behind RAII is we don't need to worry about the cleanup or the type of the object wrapped by the RAII handler (unique_ptr in this case). - Cleaned up some unnecessary conversions, type shuffling and copies around the code I touched. - Cleaned up some unsafe type casts which are prone to dereferencing null pointers. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - Ah! make_unique is a c++14 feature and we support C++11. I wonder why windows build is configured to use c++14+ while other platforms use C++11. Replacing make_unique with the new syntax to make the other platforms happy too. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - Minor cleanup - Added a test for absolute path to inexistent file. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> --------- Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit af69f39) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Change recommended Imath version to 3.1.12. This should fix Issue #1764. (#2120) Signed-off-by: Mark Titchener <mark.titchener@foundry.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 7237eaa) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Integrating matrix multiplication fix from OSL (#2121) See AcademySoftwareFoundation/OpenShadingLanguage#1513 for more details. Signed-off-by: Jerry Gamache <jerry.gamache@autodesk.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit fed973f) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Add missing setConfigIOProxy call to the Python API (#2128) * Add missing setConfigIOProxy call to the Python API Signed-off-by: Rémi Achard <remiachard@gmail.com> * Restore a clean cache for other unit tests Signed-off-by: Rémi Achard <remiachard@gmail.com> --------- Signed-off-by: Rémi Achard <remiachard@gmail.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 30db204) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * ACES 2.0 Output Transform performance optimisation (#2127) * ACES 2.0 Output Transform performance optimisation (#2119) * Extend ocioperf to take config file parameter on CLI Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extend ocioconvert to take config on command line Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extract tonescale_fwd function Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extract inverse tonescale function Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Combine c and Z variables in J calculation exponent replace 100.0 entries when referring to the scale of J Extract calculation of nonlinear compression into functions Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Split RGB<->JMh function into two parts to expose opponent intermediate values Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Use function to compute matrix multiply for LMS calculations Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove unused member variable from JMhParams structure Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Combine chromatic adaptation weights into LMS matrix (and inverse) - CHANGES PIXEL OUTPUT Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Use matrix form for transforming cone responses to Aab Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Normalise the F_L parameter Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove ra and ba related variables to avoid them being out of sync with opponent calculation Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Make A<->J conversion function generic Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Deduplicate Y<->J conversions Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Factor JMh scaling parameters into Aab matrices Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * factor our references to PI, 360 and 180 constants Avoid looking up cusp twice during inverse Whilst searching for the cusp we have already constrained the search so we do not need to clamp Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add functions to explain some of the calculations Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Further clarify when 100 means reference luminance Migrate rescaling into tonescale s_2 parameter Rename model_gamma to reflect it is actually the inverse Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * migrate init steps performed within other init functions to the top level to avoid repeat init of precomputed values. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * extract some of the fixed values that only depend on the hue to reduce recomputation during inverse gamut mapping Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Avoid double lookup for reachMaxM value by resolving once the hue is known. also reduces size of object on stack by not passing the whole table. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Push wrapping of hues to the boundary, mark up conversion points from external inputs etc Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Store gamma values as reciprocals move more magic constants into const variables factor some of the complex expressions into function (temporarily makes things slower) Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add some missing includes to headers Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * minor cleanup to use std::array instead of plain array for test samples Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Inline reach boundary finding restructure find_gamut_boundary_intersection to highlight common patterns. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extract gamut mapper compression function rework get_focus_gain to directly computer the slope_gain Share calculation of analytical thereshold Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Rework gamut mapper to compress absolute M then only recalculate calculate J Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Precalculate maximum search range for cusp lookup next steps would be to factor hue into separate table to improve cache hits followed by redistribution to more uniform hues which should narrow search range Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Experiment with reusing slope calculations in gamut mapper presmooth cusp values Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add a collection of TODO's Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Restore function mapping table index to hue Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Minor tweaks to tonescale inverse clamp Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove duplicate table whilst calculating upper hull gamma Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add some additional sample points for the upper hull gamma finder Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Slight tidy up of gamma fitting code Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Experiment with alternate smin implementation Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove unused function and tidy up comments Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extract hue search into separate function Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Extract hues into separate table, merge gamma values into their place (gamma values now sampled on cusp hue intervals). Removes extra texture from GPU path. Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Simplify upper hull gamma hue lookup to avoid unneeded lerping as we are sampling the table entries directly Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Split out tonescale function, minor tweaks to Aab->JMh Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Build tables more uniformly, needs some clean up and lots of testing Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Speed up reach corner finding by switching to testing against the Achromatic rather than J limit Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Speed up hull gamma finding by computing values which depend only on the test points and not the gamma values themselves Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Adjust GPU hue lookup to take advantage of more uniform distribution Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Fix GLSL compatibility with hue lookup Remove compiler warnings for unused parameters Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Attempt to simplify table generation code Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Explicilty allow GCC to perform additional optimisations - Needs some discussion Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add extra entries to reach table to avoid needing to clamp to range during pixel processing Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * GPU move reach Max M sampling to avoid looking it up multiple times per pixel Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove smoothing from GPU path, it is baked into the csup Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Fix bug with reach lookup Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Try only wrap hues on input to the shaders Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * rework GPU camut compressor to follow the same algorithm as CPU. Not 100% the same GPU still recalculates some values Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Rework solve_J_intersect to have fewer div instructions Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Adjust GPU code to better align with CPU code's structure, some additional precomputation is now applied during shader generation Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Precompute more scaling factors into matrices and nonlinear functions Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Experiment with unsigned integers for array access Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Bypass one J-> A conversion by saving the Aab computed earlier Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Test intrinsics for compression Norm calculation Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Attempt to calculate sin/cos only once per pixel. Some minor micro optimisations. Further alignment of GPU with CPU code, Tests values need evaluating Some GPU results are different - TBD Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove unused parameters Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Try tree vectoriser for gcc Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Add Vectorise option for MSVC Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove unused function Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Constexpr std::max is only available in C++ 14 for now avoid the call to it Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Try to fir intrinsic based errors on osome build configurations Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Another C++ 14 usage fix Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Remove check for CLANG left over from testing Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> --------- Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> * Update ACES2 CPU non-SIMD path (#2122) * - Commenting out the ACES2 SIMD implementation for now to focus on validity of the scalar math. For SIMD we need to do implement run-time switching logic too. - Slight improvements to the unit tests so that we print out the computed error metric as well as the actual and expected values. Helps to see the magnitude of the error. - FixedFunctionOpCPU and BuiltinTransform tests now produce error lines with the same structure & syntax, including the computed error. - Updated the expected values for ACES2 tests with the values the new optimized code produces, this makes all of the of CPU tests pass now. - For ACES2 ops and builtin transforms, the error threshold is increased to 1e-4 - added few, temporary code snippets that dumps the currently produced results, making it easier to update the golden values if needed again. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - Fixing Linux build Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Making Linux build happy is never easy. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> --------- Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Address GPU unit test failures (#2123) * - Weights for cos(3h) and sin(h) in chroma_compress_norm() looks wrong. Fixing the weights makes the GPU tests pass now (except of the inverse output transform which seems to have a separate issue). - If the new weights are correct, I'll need to update the CPU test target values too. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - Updating the expected values in the CPU tests Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * - The remaining GPU test failures were caused by a simple typo where we were passing h instead of J to ocio_tonescale_inv() function. With the fix all the unit tests are happy now. - Since we decided not to include any SIMD implementation in this version, I removed the conditional code paths and left the current SSE & AVX implementations as commented out for future guidence. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> --------- Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Remove unused code for old gamut table calculations (#2124) Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Minor code cleanup Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Adding negative A trap on Aab_to_JMh_Shader() per code review Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Adding copysign to tonescale to make it aligned with the CPU implementation. It's possible that on GPU we may never receive negative J due to prior guarding, but for now aligning with the CPU to be on the safer side. Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> * Add built-in transform round-trip test Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Loosen tolerance for other machines Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Add GPU round-trip tests Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Loosen tolerances for other GPUs Signed-off-by: Doug Walker <doug.walker@autodesk.com> --------- Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> Signed-off-by: Doug Walker <doug.walker@autodesk.com> Co-authored-by: Kevin Wheatley <kevin.wheatley@framestore.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 1931542) Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Increment library version to 2.4.2 Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Propose NaN fix for the ACES2 inverse output transforms (#2132) * Propose Aab_to_RGB NaN fix Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Fix for test on ARM Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Fix for tests on Linux/Windows Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Fix for GPU test on Linux Signed-off-by: Doug Walker <doug.walker@autodesk.com> * NaN fix for gamma and double log fixed functions Signed-off-by: Doug Walker <doug.walker@autodesk.com> * Remove commented-out code Signed-off-by: Doug Walker <doug.walker@autodesk.com> --------- Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 0546612) Signed-off-by: Doug Walker <doug.walker@autodesk.com> --------- Signed-off-by: Anthony Roberts <anthony.roberts@linaro.org> Signed-off-by: Doug Walker <doug.walker@autodesk.com> Signed-off-by: Taegyun Ha <taegyun.ha@disguise.one> Signed-off-by: Morteza <smostajabodaveh@apple.com> Signed-off-by: cuneyt.ozdas <cuneyt.ozdas@autodesk.com> Signed-off-by: Mark Titchener <mark.titchener@foundry.com> Signed-off-by: Jerry Gamache <jerry.gamache@autodesk.com> Signed-off-by: Rémi Achard <remiachard@gmail.com> Signed-off-by: Kevin Wheatley <kevin.wheatley@framestore.com> Co-authored-by: Anthony Roberts <anthony.roberts@linaro.org> Co-authored-by: Taegyun Ha <110908525+DevTGHa@users.noreply.github.com> Co-authored-by: Morteza Mostajab <92918486+Morteeza@users.noreply.github.com> Co-authored-by: Cuneyt Ozdas <cuneyt.ozdas@autodesk.com> Co-authored-by: Mark Titchener <mark.titchener@foundry.com> Co-authored-by: JGamache-autodesk <56274617+JGamache-autodesk@users.noreply.github.com> Co-authored-by: Rémi Achard <remiachard@gmail.com> Co-authored-by: Kevin Wheatley <kevin.wheatley@framestore.com>
1 parent ebd076a commit 6918fad

37 files changed

+2850
-1446
lines changed

CMakeLists.txt

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ endif()
2929
# Project definition.
3030

3131
project(OpenColorIO
32-
VERSION 2.4.1
32+
VERSION 2.4.2
3333
DESCRIPTION "OpenColorIO (OCIO) is a complete color management solution"
3434
HOMEPAGE_URL https://github.com/AcademySoftwareFoundation/OpenColorIO
3535
LANGUAGES CXX C)
@@ -180,7 +180,12 @@ option(OCIO_USE_OIIO_FOR_APPS "Request OIIO to build apps (ociolutimage, ociocon
180180

181181

182182
if (NOT APPLE)
183-
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(AMD64|IA64|EM64T|x86_64|X86|i386|i686)")
183+
if("${CMAKE_GENERATOR_PLATFORM}" MATCHES "(ARM64|arm64)" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ARM64")
184+
set(OCIO_ARCH_X86 0)
185+
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_SSE ON)
186+
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX OFF)
187+
set(OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C OFF)
188+
elseif ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(AMD64|IA64|EM64T|x86_64|X86|i386|i686)")
184189
# Intel-based architecture (not APPLE)
185190
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(X86|i386|i686)")
186191
set(OCIO_ARCH_X86_32 1)
@@ -270,7 +275,7 @@ option(OCIO_USE_AVX2 "Specify whether to enable AVX2 CPU performance optimizatio
270275
option(OCIO_USE_AVX512 "Specify whether to enable AVX512 CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_AVX})
271276
option(OCIO_USE_F16C "Specify whether to enable F16C CPU performance optimizations" ${OCIO_BUILD_ENABLE_OPTIMIZATIONS_F16C})
272277

273-
if (APPLE)
278+
if (APPLE OR WIN32)
274279
# TODO: Revisit whether that option is necessary.
275280
option(OCIO_USE_SSE2NEON "Specify whether to enable SSE CPU performance optimizations using SSE2NEON for Apple ARM architecture" ON)
276281
mark_as_advanced(OCIO_USE_SSE2NEON)
@@ -332,8 +337,10 @@ if(OCIO_USE_SIMD AND OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_ARM_NEON)
332337
add_library(sse2neon INTERFACE)
333338
# Add the include directories to the target.
334339
target_include_directories(sse2neon INTERFACE "${sse2neon_INCLUDE_DIR}")
335-
# Ignore the warnings coming from sse2neon.h as they are false positives.
336-
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
340+
if(NOT MSVC)
341+
# Ignore the warnings coming from sse2neon.h as they are false positives.
342+
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
343+
endif()
337344
endif()
338345
endif()
339346

share/cmake/modules/FindExtPackages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ocio_handle_dependency( pystring REQUIRED ALLOW_INSTALL
7777
# https://github.com/AcademySoftwareFoundation/Imath
7878
ocio_handle_dependency( Imath REQUIRED ALLOW_INSTALL
7979
MIN_VERSION 3.1.1
80-
RECOMMENDED_VERSION 3.1.6
80+
RECOMMENDED_VERSION 3.1.12
8181
RECOMMENDED_VERSION_REASON "Latest version tested with OCIO")
8282

8383
###############################################################################

share/cmake/modules/install/Installsse2neon.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ include(FetchContent)
1616
set(FETCHCONTENT_BASE_DIR "${CMAKE_BINARY_DIR}/ext/build/sse2neon")
1717
FetchContent_Declare(sse2neon
1818
GIT_REPOSITORY https://github.com/DLTcollab/sse2neon.git
19-
GIT_TAG v1.6.0
19+
GIT_TAG 227cc413fb2d50b2a10073087be96b59d5364aea
2020
)
2121

2222
# FetchContent_MakeAvailable is not available until CMake 3.14+.
@@ -38,6 +38,8 @@ if(NOT sse2neon_POPULATED)
3838
add_library(sse2neon INTERFACE)
3939
# Add the include directories to the target.
4040
target_include_directories(sse2neon INTERFACE "${sse2neon_INCLUDE_DIR}")
41-
# Ignore the warnings coming from sse2neon.h as they are false positives.
42-
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
41+
if(NOT MSVC)
42+
# Ignore the warnings coming from sse2neon.h as they are false positives.
43+
target_compile_options(sse2neon INTERFACE -Wno-unused-parameter)
44+
endif()
4345
endif()

share/cmake/utils/CheckSupportSSEUsingSSE2NEON.cmake

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@ include(CheckCXXSourceCompiles)
66
set(_cmake_required_flags_orig "${CMAKE_REQUIRED_FLAGS}")
77
set(_cmake_required_includes_orig "${CMAKE_REQUIRED_INCLUDES}")
88
set(_cmake_osx_architectures_orig "${CMAKE_OSX_ARCHITECTURES}")
9+
set(_cmake_cxx_flags_orig "${CMAKE_CXX_FLAGS}")
910

10-
if(APPLE AND COMPILER_SUPPORTS_ARM_NEON)
11+
if(MSVC)
12+
set(CMAKE_CXX_FLAGS "/Zc:preprocessor")
13+
endif()
14+
15+
if((APPLE OR WIN32) AND COMPILER_SUPPORTS_ARM_NEON)
1116

1217
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64;x86_64" OR
1318
"${CMAKE_OSX_ARCHITECTURES}" MATCHES "x86_64;arm64")
@@ -63,8 +68,9 @@ endif()
6368
set(CMAKE_REQUIRED_FLAGS "${_cmake_required_flags_orig}")
6469
set(CMAKE_REQUIRED_INCLUDES "${_cmake_required_includes_orig}")
6570
set(CMAKE_OSX_ARCHITECTURES "${_cmake_osx_architectures_orig}")
71+
set(CMAKE_CXX_FLAGS "${_cmake_cxx_flags_orig}")
6672

6773
unset(_cmake_required_flags_orig)
6874
unset(_cmake_required_includes_orig)
6975
unset(_cmake_osx_architectures_orig)
70-
76+
unset(_cmake_cxx_flags_orig)

share/cmake/utils/CompilerFlags.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ if(OCIO_USE_SIMD)
1818

1919
if (OCIO_USE_SSE2NEON AND COMPILER_SUPPORTS_ARM_NEON)
2020
include(CheckSupportSSEUsingSSE2NEON)
21-
if(NOT COMPILER_SUPPORTS_SSE_WITH_SSE2NEON)
21+
if(COMPILER_SUPPORTS_SSE_WITH_SSE2NEON)
22+
if(WIN32 AND MSVC)
23+
# Enable the "new" preprocessor, to more closely match Clang/GCC, required for sse2neon
24+
set(PLATFORM_COMPILE_OPTIONS "${PLATFORM_COMPILE_OPTIONS};/Zc:preprocessor")
25+
endif()
26+
else()
2227
set(OCIO_USE_SSE2NEON OFF)
2328
endif()
2429
endif()

share/dev/windows/ocio.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if NOT "%~1"=="" (
7777

7878
rem If not overridden by the cmd line args, find and use the latest Visual Studio
7979
if NOT DEFINED MSVS_PATH (
80-
for /f %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
80+
for /f "delims=" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
8181
echo Found Visual Studio installation at '%%i'
8282
set MSVS_PATH=%%i
8383
)

share/dev/windows/ocio_deps.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ if ErrorLevel 1 (
105105

106106
echo Checking for Microsoft Visual Studio...
107107
set MSVS_PATH=
108-
for /f %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
108+
for /f "delims=" %%i in ('"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -format value -property installationPath -latest') do (
109109
echo Found Visual Studio installation at '%%i'
110110
set MSVS_PATH=%%i
111111
)

src/OpenColorIO/CPUInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ CPUInfo::CPUInfo()
183183
}
184184
}
185185

186-
#elif defined(__aarch64__) // ARM Processor or Apple ARM.
186+
#elif defined(__aarch64__) || defined(_M_ARM64) // ARM 64-bit processor (multiple platforms)
187187

188188
CPUInfo::CPUInfo()
189189
{

src/OpenColorIO/CPUInfoConfig.h.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#cmakedefine01 OCIO_ARCH_X86_32
77

88
// Relevant only for arm64 architecture.
9-
#if defined(__aarch64__)
9+
#if defined(__aarch64__) || defined(_M_ARM64)
1010
#cmakedefine01 OCIO_USE_SSE2NEON
1111
#else
1212
#define OCIO_USE_SSE2NEON 0
@@ -23,7 +23,7 @@
2323

2424
// Building for x86_64 processor on a non-ARM host architecture
2525
// OR Building on/for an ARM architecture and using SSE2NEON.
26-
#if (OCIO_ARCH_X86 && !defined(__aarch64__)) || (defined(__aarch64__) && OCIO_USE_SSE2NEON)
26+
#if (OCIO_ARCH_X86 && !defined(__aarch64__)) || ((defined(__aarch64__) || defined(_M_ARM64)) && OCIO_USE_SSE2NEON)
2727
#cmakedefine01 OCIO_USE_SSE2
2828
#cmakedefine01 OCIO_USE_SSE3
2929
#cmakedefine01 OCIO_USE_SSSE3

src/OpenColorIO/GpuShaderClassWrapper.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ std::string OSLShaderClassWrapper::getClassWrapperHeader(const std::string& orig
6666
st.newLine() << "vector4 __operator__mul__(matrix m, vector4 v)";
6767
st.newLine() << "{";
6868
st.indent();
69-
st.newLine() << "return vector4(v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3], ";
70-
st.newLine() << " v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3], ";
71-
st.newLine() << " v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3], ";
72-
st.newLine() << " v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2] + v.w * m[3][3]);";
69+
st.newLine() << "return transform(m, v);";
7370
st.dedent();
7471
st.newLine() << "}";
7572

0 commit comments

Comments
 (0)