Skip to content

Commit 422b3fe

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into add-testrender-volumes
2 parents 17c509e + 4b5fc37 commit 422b3fe

38 files changed

Lines changed: 514 additions & 667 deletions

.github/workflows/build-steps.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ jobs:
101101
CTEST_TEST_TIMEOUT: ${{inputs.ctest_test_timeout}}
102102
USE_SIMD: ${{inputs.simd}}
103103
FMT_VERSION: ${{inputs.fmt_ver}}
104+
fmt_BUILD_VERSION: ${{inputs.fmt_ver}}
104105
OPENCOLORIO_VERSION: ${{inputs.opencolorio_ver}}
105106
OPENEXR_VERSION: ${{inputs.openexr_ver}}
106107
OPENIMAGEIO_VERSION: ${{inputs.openimageio_ver}}
@@ -134,7 +135,7 @@ jobs:
134135
restore-keys: ${{inputs.nametag}}
135136
- name: Install LLVM and Clang
136137
if: inputs.llvm_action_ver != ''
137-
uses: KyleMayes/install-llvm-action@a7a1a882e2d06ebe05d5bb97c3e1f8c984ae96fc # v2.0.7
138+
uses: KyleMayes/install-llvm-action@98e68e10c96dffcb7bfed8b2144541a66b49aa02 # v2.0.8
138139
with:
139140
version: ${{ inputs.llvm_action_ver }}
140141
- name: Dependencies

.github/workflows/ci.yml

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -411,25 +411,44 @@ jobs:
411411
setenvs: export LLVM_VERSION=14.0.0 LLVM_DISTRO_NAME=ubuntu-18.04
412412
OPENIMAGEIO_CMAKE_FLAGS="-DBUILD_FMT_VERSION=7.0.1"
413413
PUGIXML_VERSION=v1.10
414-
- desc: latest releases gcc11/C++17 llvm17 oiio-rel exr3.2 py3.12 avx2 batch-b16avx512
414+
- desc: latest releases gcc13/C++17 llvm18 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
415415
nametag: linux-latest-releases
416416
runner: ubuntu-24.04
417-
cc_compiler: gcc-13
418-
cxx_compiler: g++-13
417+
cc_compiler: gcc-14
418+
cxx_compiler: g++-14
419419
cxx_std: 17
420-
fmt_ver: 11.1.4
421-
opencolorio_ver: v2.4.2
422-
openexr_ver: v3.3.3
420+
fmt_ver: 12.1.0
421+
opencolorio_ver: v2.5.0
422+
openexr_ver: v3.4.2
423423
openimageio_ver: release
424-
pybind11_ver: v3.0.0
424+
pybind11_ver: v3.0.1
425425
python_ver: "3.12"
426426
llvm_action_ver: "18.1.7"
427427
simd: avx2,f16c
428428
batched: b8_AVX2,b8_AVX512,b16_AVX512
429-
setenvs: export LIBTIFF_VERSION=v4.7.0
429+
setenvs: export LIBTIFF_VERSION=v4.7.1
430430
PTEX_VERSION=v2.4.3
431431
PUGIXML_VERSION=v1.15
432-
FREETYPE_VERSION=VER-2-13-3
432+
FREETYPE_VERSION=VER-2-14-3
433+
- desc: latest releases clang18/C++17 llvm18 oiio-rel exr3.4 py3.12 avx2 batch-b16avx512
434+
nametag: linux-latest-releases
435+
runner: ubuntu-24.04
436+
cc_compiler: clang
437+
cxx_compiler: clang++
438+
cxx_std: 17
439+
fmt_ver: 12.1.0
440+
opencolorio_ver: v2.5.0
441+
openexr_ver: v3.4.2
442+
openimageio_ver: release
443+
pybind11_ver: v3.0.1
444+
python_ver: "3.12"
445+
llvm_action_ver: "18.1.7"
446+
simd: avx2,f16c
447+
batched: b8_AVX2,b8_AVX512,b16_AVX512
448+
setenvs: export LIBTIFF_VERSION=v4.7.1
449+
PTEX_VERSION=v2.4.3
450+
PUGIXML_VERSION=v1.15
451+
FREETYPE_VERSION=VER-2-14-3
433452
- desc: bleeding edge gcc14/C++17 llvm17 oiio/ocio/exr/pybind-main py3.12 avx2 batch-b16avx512
434453
nametag: linux-bleeding-edge
435454
runner: ubuntu-24.04
@@ -446,23 +465,26 @@ jobs:
446465
simd: avx2,f16c
447466
batched: b8_AVX2,b8_AVX512,b16_AVX512
448467
setenvs: export PUGIXML_VERSION=master
468+
PTEX_VERSION=v2.4.3
469+
PUGIXML_VERSION=v1.15
470+
FREETYPE_VERSION=VER-2-14-3
449471
- desc: clang14/C++17 llvm14 py3.10 avx2 batch-b16avx512
450472
nametag: linux-latest-releases-clang
451473
runner: ubuntu-22.04
452474
cxx_compiler: clang++
453475
cc_compiler: clang
454476
cxx_std: 17
455-
fmt_ver: 8.1.1
477+
fmt_ver: 12.1.0
456478
opencolorio_ver: v2.5.0
457-
openexr_ver: v3.1.11
479+
openexr_ver: v3.4.2
458480
openimageio_ver: release
459-
pybind11_ver: v2.13.6
481+
pybind11_ver: v3.0.1
460482
python_ver: "3.10"
461483
simd: avx2,f16c
462484
batched: b8_AVX2,b8_AVX512,b16_AVX512
463485
setenvs: export LLVM_VERSION=14.0.0
464486
LLVM_DISTRO_NAME=ubuntu-18.04
465-
PUGIXML_VERSION=v1.11.4
487+
PUGIXML_VERSION=v1.15
466488
# Test formatting. This test entry doesn't do a full build, it
467489
# just runs clang-format on everything, and passes if nothing is
468490
# misformatted. Upon failure, the build artifact will be the full
@@ -522,15 +544,14 @@ jobs:
522544
fail-fast: false
523545
matrix:
524546
include:
525-
- desc: MacOS-13-Intel llvm17 oiio-release
526-
runner: macos-13
527-
nametag: macos13-p313
547+
- desc: MacOS-15-Intel aclang17/C++17/py3.13 llvm17 oiio-release
548+
runner: macos-15-intel
549+
nametag: macos15-p313
528550
cc_compiler: clang
529551
cxx_compiler: clang++
530552
cxx_std: 17
531553
openimageio_ver: dev-3.0
532554
python_ver: "3.13"
533-
aclang: 14
534555
ctest_test_timeout: 120
535556
setenvs: export HOMEBREW_PREFIX=/usr/local
536557
LLVMBREWVER="@17"
@@ -543,17 +564,15 @@ jobs:
543564
cxx_std: 17
544565
openimageio_ver: main
545566
python_ver: "3.13"
546-
aclang: 15
547567
setenvs: export LLVMBREWVER="@19"
548-
- desc: MacOS-15-ARM aclang16/C++17/py3.13 llvm19 oiio-main
568+
- desc: MacOS-15-ARM aclang16/C++17/py3.13 llvm21 oiio-main
549569
runner: macos-15
550570
nametag: macos15-arm-py313
551571
cc_compiler: clang
552572
cxx_compiler: clang++
553573
cxx_std: 17
554574
python_ver: "3.13"
555575
openimageio_ver: main
556-
setenvs: export LLVMBREWVER="@19"
557576

558577

559578
windows:

INSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ NEW or CHANGED minimum dependencies since the last major release are **bold**.
4949
$OpenImageIO_ROOT/lib to be in your LD_LIBRARY_PATH (or
5050
DYLD_LIBRARY_PATH on OS X).
5151

52-
* [LLVM](http://www.llvm.org) **14.0 or newer**, 15, 16, 17, 18, 19, 20,
52+
* [LLVM](http://www.llvm.org) **14.0 or newer**, 15, 16, 17, 18, 19, 20, 21,
5353
including clang libraries.
5454

5555
* (optional) For GPU rendering on NVIDIA GPUs:

src/cmake/externalpackages.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ checked_find_package (pugixml REQUIRED
5858
# LLVM library setup
5959
checked_find_package (LLVM REQUIRED
6060
VERSION_MIN 14.0
61-
VERSION_MAX 20.9
61+
VERSION_MAX 21.9
6262
PRINT LLVM_SYSTEM_LIBRARIES CLANG_LIBRARIES
6363
LLVM_SHARED_MODE)
6464
# ensure include directory is added (in case of non-standard locations

src/include/OSL/platform.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,21 @@
200200
#endif
201201

202202
// Compiler-specific pragmas
203+
//
204+
// - OSL_PRAGMA_WARNING_PUSH/POP pushes/pops warning options (for all
205+
// compilers).
206+
// - OSL_PRAGMA_VISIBILITY_PUSH/POP pushes/pops symbol visibility options (for
207+
// all compilers that support it).
208+
// - OSL_GCC_PRAGMA makes a pragma for all gcc-like compilers, but does nothing
209+
// for MSVS.
210+
// - OSL_GCC_ONLY_PRAGMA makes a pragma for real gcc only.
211+
// - OSL_CLANG_PRAGMA makes a pragma for all clang-based compilers (including
212+
// Apple clang and Intel LLVM).
213+
// - OSL_NONINTEL_CLANG_PRAGMA makes a pragma for regular clang and Apple
214+
// clang, but not Intel clang.
215+
// - OSL_INTEL_CLASSIC_PRAGMA makes a pragma for icc only.
216+
// - OSL_INTEL_LLVM_PRAGMA makes a pragma for icx only.
217+
// - OSL_MSVS_PRAGMA makes a pragma for MSVS only.
203218
#if defined(__GNUC__) /* gcc, clang, icc */
204219
# define OSL_PRAGMA_WARNING_PUSH OSL_PRAGMA(GCC diagnostic push)
205220
# define OSL_PRAGMA_WARNING_POP OSL_PRAGMA(GCC diagnostic pop)
@@ -223,6 +238,11 @@
223238
# else
224239
# define OSL_INTEL_LLVM_PRAGMA(UnQuotedPragma)
225240
# endif
241+
# if defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
242+
# define OSL_NONINTEL_CLANG_PRAGMA(UnQuotedPragma) OSL_PRAGMA(UnQuotedPragma)
243+
# else
244+
# define OSL_NONINTEL_CLANG_PRAGMA(UnQuotedPragma)
245+
# endif
226246
# define OSL_MSVS_PRAGMA(UnQuotedPragma)
227247
#elif defined(_MSC_VER)
228248
# define OSL_PRAGMA_WARNING_PUSH __pragma(warning(push))
@@ -232,6 +252,7 @@
232252
# define OSL_GCC_PRAGMA(UnQuotedPragma)
233253
# define OSL_GCC_ONLY_PRAGMA(UnQuotedPragma)
234254
# define OSL_CLANG_PRAGMA(UnQuotedPragma)
255+
# define OSL_NONINTEL_CLANG_PRAGMA(UnQuotedPragma)
235256
# define OSL_INTEL_CLASSIC_PRAGMA(UnQuotedPragma)
236257
# define OSL_INTEL_LLVM_PRAGMA(UnQuotedPragma)
237258
# define OSL_MSVS_PRAGMA(UnQuotedPragma) OSL_PRAGMA(UnQuotedPragma)
@@ -243,6 +264,7 @@
243264
# define OSL_GCC_PRAGMA(UnQuotedPragma)
244265
# define OSL_GCC_ONLY_PRAGMA(UnQuotedPragma)
245266
# define OSL_CLANG_PRAGMA(UnQuotedPragma)
267+
# define OSL_NONINTEL_CLANG_PRAGMA(UnQuotedPragma)
246268
# define OSL_INTEL_CLASSIC_PRAGMA(UnQuotedPragma)
247269
# define OSL_INTEL_LLVM_PRAGMA(UnQuotedPragma)
248270
# define OSL_MSVS_PRAGMA(UnQuotedPragma)
@@ -291,6 +313,7 @@
291313
#define OSL_OMP_SIMD_LOOP(...) OSL_OMP_PRAGMA(omp simd __VA_ARGS__)
292314

293315
#if (OSL_GNUC_VERSION || OSL_INTEL_CLASSIC_COMPILER_VERSION || OSL_INTEL_LLVM_COMPILER_VERSION)
316+
// GCC, icc, icx: Use a simd loop for sure
294317
# define OSL_OMP_COMPLEX_SIMD_LOOP(...) OSL_OMP_SIMD_LOOP(__VA_ARGS__)
295318
#else
296319
// Ignore requests to vectorize complex/nested SIMD loops for certain

src/include/OSL/rs_free_function.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,13 @@ OSL_RSOP OSL_HOSTDEVICE bool
316316
rs_trace_get(OSL::OpaqueExecContextPtr oec, OSL::ustringhash name,
317317
OSL::TypeDesc type, void* val, bool derivatives);
318318

319+
/// Allocates memory for a closure color. May return null if no memory could
320+
/// be allocated. It is the renderers responsibility to clean up these
321+
/// allocations after a shader is run and the closures have been processed.
322+
OSL_RSOP OSL_HOSTDEVICE void*
323+
rs_allocate_closure(OSL::OpaqueExecContextPtr oec, size_t size,
324+
size_t alignment);
325+
319326
/// Report errors, warnings, printf, and fprintf.
320327
/// Fmtlib style format specifier is used (vs. printf style)
321328
/// Arguments are represented as EncodedTypes (encodedtypes.h) and

src/include/OSL/strdecls.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
# error Do not include this file unless STRDECL is defined
1515
#endif
1616

17+
// avoid naming conflict with MSVC macro
18+
#ifdef RGB
19+
# undef RGB
20+
#endif
1721

1822
STRDECL("", _emptystring_)
1923
STRDECL("camera", camera)

src/liboslcomp/oslcomp.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,32 @@ OSLCompilerImpl::preprocess_buffer(const std::string& buffer,
171171
llvm::raw_string_ostream errstream(preproc_errors);
172172
clang::DiagnosticOptions* diagOptions = new clang::DiagnosticOptions();
173173
clang::TextDiagnosticPrinter* diagPrinter
174+
#if OSL_LLVM_VERSION < 210
174175
= new clang::TextDiagnosticPrinter(errstream, diagOptions);
176+
#else
177+
= new clang::TextDiagnosticPrinter(errstream, *diagOptions);
178+
#endif
175179
llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> diagIDs(
176180
new clang::DiagnosticIDs);
177181
clang::DiagnosticsEngine* diagEngine
182+
#if OSL_LLVM_VERSION < 210
178183
= new clang::DiagnosticsEngine(diagIDs, diagOptions, diagPrinter);
184+
#else
185+
= new clang::DiagnosticsEngine(diagIDs, *diagOptions, diagPrinter);
186+
#endif
179187
inst.setDiagnostics(diagEngine);
180188

181189
const std::shared_ptr<clang::TargetOptions> targetopts
182190
= std::make_shared<clang::TargetOptions>(inst.getTargetOpts());
183191
targetopts->Triple = llvm::sys::getDefaultTargetTriple();
184192
clang::TargetInfo* target
193+
#if OSL_LLVM_VERSION < 210
185194
= clang::TargetInfo::CreateTargetInfo(inst.getDiagnostics(),
186195
targetopts);
196+
#else
197+
= clang::TargetInfo::CreateTargetInfo(inst.getDiagnostics(),
198+
*targetopts);
199+
#endif
187200

188201
inst.setTarget(target);
189202

src/liboslexec/CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ if (USE_LLVM_BITCODE)
194194
EMBED_LLVM_BITCODE_IN_CPP ( "${llvm_ops_srcs}" "_host" "osl_llvm_compiled_ops" lib_src "" "${include_dirs}")
195195

196196
set (rs_dependent_ops_srcs
197-
opmatrix.cpp opfmt.cpp optexture.cpp pointcloud.cpp
197+
opmatrix.cpp opfmt.cpp optexture.cpp pointcloud.cpp opclosure.cpp
198198
)
199199
# Achieve the effect of absorbing osl_llvm_compiled_ops by adding its
200200
# sources to rs_dependent_ops_srcs which avoids having to do it at runtime.
@@ -217,6 +217,7 @@ if (USE_LLVM_BITCODE)
217217
${CMAKE_SOURCE_DIR}/src/liboslexec/opmatrix.cpp
218218
${CMAKE_SOURCE_DIR}/src/liboslexec/optexture.cpp
219219
${CMAKE_SOURCE_DIR}/src/liboslexec/pointcloud.cpp
220+
${CMAKE_SOURCE_DIR}/src/liboslexec/opclosure.cpp
220221
${CMAKE_SOURCE_DIR}/src/liboslnoise/gabornoise.cpp
221222
${CMAKE_SOURCE_DIR}/src/liboslnoise/simplexnoise.cpp
222223
)
@@ -508,7 +509,10 @@ foreach(batched_target ${BATCHED_TARGET_LIST})
508509
endforeach(target_src)
509510

510511
add_library ( ${batched_target_lib} MODULE ${TARGET_LIB_SOURCES} )
511-
512+
if (WIN32)
513+
set_target_properties( ${batched_target_lib} PROPERTIES PREFIX "lib" )
514+
endif()
515+
512516
target_include_directories (${batched_target_lib}
513517
PUBLIC
514518
${CMAKE_INSTALL_FULL_INCLUDEDIR}

src/liboslexec/builtindecl.h

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,29 +109,14 @@
109109
DECL(osl_##name##_dvdvv, "xXXX")
110110

111111

112-
113-
#ifndef __CUDA_ARCH__
114-
DECL(osl_add_closure_closure, "CXCC")
115-
DECL(osl_mul_closure_float, "CXCf")
116-
DECL(osl_mul_closure_color, "CXCc")
117-
DECL(osl_allocate_closure_component, "CXii")
118-
DECL(osl_allocate_weighted_closure_component, "CXiiX")
119-
DECL(osl_closure_to_string, "sXC")
120-
DECL(osl_closure_to_ustringhash, "hXC")
121-
#else
122-
// TODO: Figure out why trying to match the signatures between host and device
123-
// definitions fails with 'LLVM had to make a cast' assertion failure.
124-
//
125-
// In the meantime, use a signature that matches the definitions in rend_lib.cu,
126-
// where void* is used instead of ClosureColor* and ShaderGlobals*.
127112
DECL(osl_add_closure_closure, "XXXX")
128113
DECL(osl_mul_closure_float, "XXXf")
129-
DECL(osl_mul_closure_color, "XXXc")
114+
DECL(osl_mul_closure_color, "XXXX")
130115
DECL(osl_allocate_closure_component, "XXii")
131116
DECL(osl_allocate_weighted_closure_component, "XXiiX")
132117
DECL(osl_closure_to_string, "sXX")
133118
DECL(osl_closure_to_ustringhash, "hXX")
134-
#endif
119+
135120
DECL(osl_format, "hh*")
136121
DECL(osl_gen_ustringhash_pod, "hs")
137122
DECL(osl_gen_ustring, "sh")

0 commit comments

Comments
 (0)