Skip to content

Commit 7ce9a4e

Browse files
authored
Merge branch 'AcademySoftwareFoundation:main' into testminimal
2 parents beca645 + b20a55e commit 7ce9a4e

File tree

50 files changed

+226
-111
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+226
-111
lines changed

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ jobs:
104104
cxx_std: 17
105105
openimageio_ver: master
106106
python_ver: 3.9
107-
pybind11_ver: v2.6.2
107+
pybind11_ver: v2.7.0
108108
simd: avx2,f16c
109109
batched: b8_AVX2,b8_AVX512,b16_AVX512
110110
setenvs: USE_OPENVDB=0
@@ -180,7 +180,7 @@ jobs:
180180
openexr_ver: v2.4.3
181181
openimageio_ver: v2.4.13.0
182182
python_ver: 2.7
183-
pybind11_ver: v2.6.2
183+
pybind11_ver: v2.7.0
184184
simd: 0
185185
setenvs: export PUGIXML_VERSION=v1.8
186186
CMAKE_VERSION=3.15.5

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ add_definitions (-DOSL_INTERNAL=1)
143143

144144
# To make sure we aren't relying on deprecated OIIO features, we define
145145
# OIIO_DISABLE_DEPRECATED before including any OIIO headers.
146-
add_definitions (-DOIIO_DISABLE_DEPRECATED=1)
146+
add_definitions (-DOIIO_DISABLE_DEPRECATED=900000)
147147

148148
# Set the default namespace. For symbol hiding reasons, it's important that
149149
# the project name is a subset of the namespace name.

src/build-scripts/ci-startup.bash

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ export DYLD_LIBRARY_PATH=${LOCAL_DEPS_DIR}/dist/lib:$DYLD_LIBRARY_PATH
4747

4848
export TESTSUITE_CLEANUP_ON_SUCCESS=${TESTSUITE_CLEANUP_ON_SUCCESS:=1}
4949

50+
# For CI, default to building missing dependencies automatically
51+
export OpenImageIO_BUILD_MISSING_DEPS=${OpenImageIO_BUILD_MISSING_DEPS:=all}
52+
5053
# Parallel builds
5154
if [[ `uname -s` == "Linux" ]] ; then
5255
echo "procs: " `nproc`

src/cmake/compiler.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ message (STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
2525
###########################################################################
2626
# C++ language standard
2727
#
28-
set (CMAKE_CXX_STANDARD 14 CACHE STRING
28+
set (CMAKE_CXX_STANDARD 17 CACHE STRING
2929
"C++ standard to build with (14, 17, 20, etc.)")
3030
set (DOWNSTREAM_CXX_STANDARD 14 CACHE STRING
3131
"C++ minimum standard to impose on downstream clients")

src/doc/languagespec.tex

+7-15
Original file line numberDiff line numberDiff line change
@@ -5049,27 +5049,19 @@ \subsection{Surface BSDF closures}
50495049

50505050
\apiitem{albedo}
50515051
\vspace{12pt}
5052-
Single-scattering albedo of the medium.
5053-
\apiend
5054-
\vspace{-16pt}
5055-
5056-
\apiitem{transmission_depth}
5057-
\vspace{12pt}
5058-
Distance travelled inside the medium by white light before its color becomes
5059-
transmission_color by Beer's law. Given in scene length units, range
5060-
[0,infinity). Together with transmission_color this determines the
5061-
extinction coefficient of the medium.
5052+
Effective albedo of the medium (after multiple scattering). The renderer is expected to
5053+
invert this color to derive the appropriate single-scattering albedo that will produce
5054+
this color for the average random walk.
50625055
\apiend
50635056
\vspace{-16pt}
50645057

5065-
\apiitem{transmission_color}
5058+
\apiitem{radius}
50665059
\vspace{12pt}
5067-
Desired color resulting from white light transmitted a distance of
5068-
'transmission_depth' through the medium. Together with transmission_depth
5069-
this determines the extinction coefficient of the medium.
5060+
Average distance travelled inside the medium per color channel. This is typically taken
5061+
to be the mean-free path of the volume.
50705062
\apiend
50715063
\vspace{-16pt}
5072-
5064+
50735065
\apiitem{anisotropy}
50745066
\vspace{12pt}
50755067
Scattering anisotropy [-1,1]. Negative values give backwards scattering,

src/doc/stdlib.md

+4-7
Original file line numberDiff line numberDiff line change
@@ -1506,14 +1506,11 @@ properties of the physically-based shading nodes of MaterialX v1.38
15061506
: Normal vector of the surface point being shaded.
15071507

15081508
`albedo`
1509-
: Single-scattering albedo of the medium.
1510-
1511-
`transmission_depth`
1512-
: Distance travelled inside the medium by white light before its color becomes transmission_color by Beer's law. Given in scene length units, range [0,infinity). Together with transmission_color this determines the extinction coefficient of the medium.
1513-
1514-
`transmission_color`
1515-
: Desired color resulting from white light transmitted a distance of 'transmission_depth' through the medium. Together with transmission_depth this determines the extinction coefficient of the medium.
1509+
: Effective albedo of the medium (after multiple scattering). The renderer is expected to invert this color to derive the appropriate single-scattering albedo that will produce this color for the average random walk.
15161510

1511+
`radius`
1512+
: Average distance travelled inside the medium per color channel. This is typically taken to be the mean-free path of the volume.
1513+
15171514
`anisotropy`
15181515
: Scattering anisotropy [-1,1]. Negative values give backwards scattering, positive values give forward scattering, and 0.0 gives uniform scattering.
15191516

src/include/OSL/oslnoise.h

+15-15
Original file line numberDiff line numberDiff line change
@@ -154,28 +154,28 @@ bitcast_to_uint (float x)
154154
OSL_FORCEINLINE void
155155
bjmix(vint4& a, vint4& b, vint4& c)
156156
{
157-
using OIIO::simd::rotl32;
158-
a -= c; a ^= rotl32(c, 4); c += b;
159-
b -= a; b ^= rotl32(a, 6); a += c;
160-
c -= b; c ^= rotl32(b, 8); b += a;
161-
a -= c; a ^= rotl32(c,16); c += b;
162-
b -= a; b ^= rotl32(a,19); a += c;
163-
c -= b; c ^= rotl32(b, 4); b += a;
157+
using OIIO::simd::rotl;
158+
a -= c; a ^= rotl(c, 4); c += b;
159+
b -= a; b ^= rotl(a, 6); a += c;
160+
c -= b; c ^= rotl(b, 8); b += a;
161+
a -= c; a ^= rotl(c,16); c += b;
162+
b -= a; b ^= rotl(a,19); a += c;
163+
c -= b; c ^= rotl(b, 4); b += a;
164164
}
165165

166166
// Perform a bjfinal (see OpenImageIO/hash.h) on 4 sets of values at once.
167167
OSL_FORCEINLINE vint4
168168
bjfinal(const vint4& a_, const vint4& b_, const vint4& c_)
169169
{
170-
using OIIO::simd::rotl32;
170+
using OIIO::simd::rotl;
171171
vint4 a(a_), b(b_), c(c_);
172-
c ^= b; c -= rotl32(b,14);
173-
a ^= c; a -= rotl32(c,11);
174-
b ^= a; b -= rotl32(a,25);
175-
c ^= b; c -= rotl32(b,16);
176-
a ^= c; a -= rotl32(c,4);
177-
b ^= a; b -= rotl32(a,14);
178-
c ^= b; c -= rotl32(b,24);
172+
c ^= b; c -= rotl(b,14);
173+
a ^= c; a -= rotl(c,11);
174+
b ^= a; b -= rotl(a,25);
175+
c ^= b; c -= rotl(b,16);
176+
a ^= c; a -= rotl(c,4);
177+
b ^= a; b -= rotl(a,14);
178+
c ^= b; c -= rotl(b,24);
179179
return c;
180180
}
181181
#endif

src/liboslexec/llvm_ops.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -628,19 +628,19 @@ osl_step_vvv(void* result, void* edge, void* x)
628628
OSL_SHADEOP int
629629
osl_isnan_if(float f)
630630
{
631-
return OIIO::isnan(f);
631+
return std::isnan(f);
632632
}
633633

634634
OSL_SHADEOP int
635635
osl_isinf_if(float f)
636636
{
637-
return OIIO::isinf(f);
637+
return std::isinf(f);
638638
}
639639

640640
OSL_SHADEOP int
641641
osl_isfinite_if(float f)
642642
{
643-
return OIIO::isfinite(f);
643+
return std::isfinite(f);
644644
}
645645

646646

@@ -694,7 +694,7 @@ safe_div(float a, float b)
694694
// to see if is finite and return 0.0f when it is not.
695695
// Typical implementation isfinite is (fabs(v) != INF), so not too expensive.
696696
float q = a / b;
697-
return OIIO::isfinite(q) ? q : 0.0f;
697+
return std::isfinite(q) ? q : 0.0f;
698698
// TODO: add a FTZ mode and only add checking the result when FTZ is disabled
699699
#endif
700700
}

src/liboslexec/optexture.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ OSL_SHADEOP void
184184
osl_texture_set_interp(void* opt, ustringhash_pod modename_)
185185
{
186186
ustringhash modename_hash = ustringhash_from(modename_);
187-
ustring modename = ustring_from(modename_hash);
188-
int mode = tex_interp_to_code(modename);
187+
int mode = tex_interp_to_code(modename_hash);
189188
if (mode >= 0)
190189
((TextureOpt*)opt)->interpmode = (TextureOpt::InterpMode)mode;
191190
}

src/liboslexec/runtimeoptimize.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -3348,8 +3348,7 @@ RuntimeOptimizer::run()
33483348
m_unknown_closures_needed = true;
33493349
}
33503350
} else if (op.opname() == u_backfacing) {
3351-
m_globals_needed.insert(u_N);
3352-
m_globals_needed.insert(u_I);
3351+
m_globals_needed.insert(u_backfacing);
33533352
} else if (op.opname() == u_calculatenormal) {
33543353
m_globals_needed.insert(u_flipHandedness);
33553354
} else if (op.opname() == u_getattribute) {

src/liboslexec/shadingsys.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -4599,7 +4599,7 @@ osl_naninf_check(int ncomps, const void* vals_, int has_derivs, void* sg,
45994599
for (int d = 0; d < (has_derivs ? 3 : 1); ++d) {
46004600
for (int c = firstcheck, e = c + nchecks; c < e; ++c) {
46014601
int i = d * ncomps + c;
4602-
if (!OIIO::isfinite(vals[i])) {
4602+
if (!std::isfinite(vals[i])) {
46034603
OSL::errorfmt(ec, "Detected {} value in {}{} at {}:{} (op {})",
46044604
vals[i], d > 0 ? "the derivatives of " : "",
46054605
OSL::ustringhash_from(symbolname_),
@@ -4635,7 +4635,7 @@ osl_uninit_check(long long typedesc_, void* vals_, void* sg,
46354635
if (typedesc.basetype == TypeDesc::FLOAT) {
46364636
float* vals = (float*)vals_;
46374637
for (int c = firstcheck, e = firstcheck + nchecks; c < e; ++c)
4638-
if (!OIIO::isfinite(vals[c])) {
4638+
if (!std::isfinite(vals[c])) {
46394639
uninit = true;
46404640
vals[c] = 0;
46414641
}

src/liboslexec/wide/wide_optest_float.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,14 @@ OSL_USING_DATA_WIDTH(__OSL_WIDTH)
2525

2626
#include "define_opname_macros.h"
2727

28-
#define __OSL_XMACRO_ARGS (isnan, OIIO::isnan)
29-
//#define __OSL_XMACRO_ARGS (isnan,std::isnan)
28+
#define __OSL_XMACRO_ARGS (isnan, std::isnan)
3029
#include "wide_optest_float_xmacro.h"
3130

32-
#define __OSL_XMACRO_ARGS (isinf, OIIO::isinf)
31+
#define __OSL_XMACRO_ARGS (isinf, std::isinf)
3332
//#define __OSL_XMACRO_ARGS (isinf, sfm::isinf)
34-
//#define __OSL_XMACRO_ARGS (isinf, std::isinf)
3533
#include "wide_optest_float_xmacro.h"
3634

37-
#define __OSL_XMACRO_ARGS (isfinite, OIIO::isfinite)
38-
//#define __OSL_XMACRO_ARGS (isfinite,std::isfinite)
35+
#define __OSL_XMACRO_ARGS (isfinite, std::isfinite)
3936
#include "wide_optest_float_xmacro.h"
4037

4138

src/liboslexec/wide/wide_shadingsys.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ __OSL_OP(naninf_check)(int ncomps, const void* vals_, int has_derivs,
3939
for (int d = 0; d < (has_derivs ? 3 : 1); ++d) {
4040
for (int c = firstcheck, e = c + nchecks; c < e; ++c) {
4141
int i = d * ncomps + c;
42-
if (!OIIO::isfinite(vals[i])) {
42+
if (!std::isfinite(vals[i])) {
4343
ctx->errorfmt("Detected {} value in {}{} at {}:{} (op {})",
4444
vals[i], d > 0 ? "the derivatives of " : "",
4545
ustring_from(symbolname),
@@ -69,7 +69,7 @@ __OSL_MASKED_OP1(naninf_check_offset,
6969
for (int c = firstcheck, e = c + nchecks; c < e; ++c) {
7070
int i = d * ncomps + c;
7171
mask.foreach ([=](ActiveLane lane) -> void {
72-
if (!OIIO::isfinite(vals[i * __OSL_WIDTH + lane])) {
72+
if (!std::isfinite(vals[i * __OSL_WIDTH + lane])) {
7373
ctx->errorfmt(
7474
"Detected {} value in {}{} at {}:{} (op {}) batch lane:{}",
7575
vals[i * __OSL_WIDTH + lane],
@@ -108,7 +108,7 @@ __OSL_MASKED_OP1(naninf_check_offset,
108108
int firstcheck = wOffsets[lane];
109109
for (int c = firstcheck, e = c + nchecks; c < e; ++c) {
110110
int i = d * ncomps + c;
111-
if (!OIIO::isfinite(vals[i * __OSL_WIDTH + lane])) {
111+
if (!std::isfinite(vals[i * __OSL_WIDTH + lane])) {
112112
ctx->errorfmt(
113113
"Detected {} value in {}{} at {}:{} (op {}) batch lane:{}",
114114
vals[i * __OSL_WIDTH + lane],
@@ -145,7 +145,7 @@ __OSL_OP2(uninit_check_values_offset, X,
145145
if (typedesc.basetype == TypeDesc::FLOAT) {
146146
float* vals = (float*)vals_;
147147
for (int c = firstcheck, e = firstcheck + nchecks; c < e; ++c)
148-
if (!OIIO::isfinite(vals[c])) {
148+
if (!std::isfinite(vals[c])) {
149149
uninit = true;
150150
vals[c] = 0;
151151
}
@@ -202,7 +202,7 @@ __OSL_MASKED_OP2(uninit_check_values_offset, WX,
202202
float* vals = (float*)vals_;
203203
for (int c = firstcheck, e = firstcheck + nchecks; c < e; ++c)
204204
mask.foreach ([=, &lanes_uninit](ActiveLane lane) -> void {
205-
if (!OIIO::isfinite(vals[c * __OSL_WIDTH + lane])) {
205+
if (!std::isfinite(vals[c * __OSL_WIDTH + lane])) {
206206
lanes_uninit.set_on(lane);
207207
vals[c * __OSL_WIDTH + lane] = 0;
208208
}
@@ -268,7 +268,7 @@ __OSL_MASKED_OP2(uninit_check_values_offset, X,
268268
mask.foreach ([=, &lanes_uninit](ActiveLane lane) -> void {
269269
int firstcheck = wOffsets[lane];
270270
for (int c = firstcheck, e = firstcheck + nchecks; c < e; ++c)
271-
if (!OIIO::isfinite(vals[c])) {
271+
if (!std::isfinite(vals[c])) {
272272
lanes_uninit.set_on(lane);
273273
vals[c] = 0;
274274
}
@@ -335,7 +335,7 @@ __OSL_MASKED_OP2(uninit_check_values_offset, WX,
335335
mask.foreach ([=, &lanes_uninit](ActiveLane lane) -> void {
336336
int firstcheck = wOffsets[lane];
337337
for (int c = firstcheck, e = firstcheck + nchecks; c < e; ++c)
338-
if (!OIIO::isfinite(vals[c * __OSL_WIDTH + lane])) {
338+
if (!std::isfinite(vals[c * __OSL_WIDTH + lane])) {
339339
lanes_uninit.set_on(lane);
340340
vals[c * __OSL_WIDTH + lane] = 0;
341341
}

src/liboslnoise/gabornoise.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ gabor_cell(GaborParams& gp, const Vec3& c_i, const Dual2<Vec3>& x_c_i,
175175
Dual2<float> gk = gabor_kernel(w_i_t_s_f, omega_i_t_s_f,
176176
phi_i_t_s_f, a_i_t_s_f,
177177
x_k_i_t); // 2D
178-
if (!OIIO::isfinite(gk.val())) {
178+
if (!std::isfinite(gk.val())) {
179179
// Numeric failure of the filtered version. Fall
180180
// back on the unfiltered.
181181
gk = gabor_kernel(gp.weight, omega_i, phi_i, gp.a,

src/liboslnoise/sfm_gabornoise.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ gabor_cell(const sfm::GaborUniformParams& gup, const sfm::GaborParams& gp,
367367
//bool not_finite = std::isnan(gk.val()) | std::isinf(gk.val());
368368
bool not_finite = std::isnan(gk.val()) || std::isinf(gk.val());
369369
#else
370-
bool not_finite = !OIIO::isfinite(gk.val());
370+
bool not_finite = !std::isfinite(gk.val());
371371
#endif
372372
if (OSL_UNLIKELY(not_finite)) {
373373
// Numeric failure of the filtered version. Fall

src/shaders/stdosl.h

+3-7
Original file line numberDiff line numberDiff line change
@@ -587,17 +587,13 @@ closure color transparent_bsdf() BUILTIN;
587587
// Constructs a BSSRDF for subsurface scattering within a homogeneous medium.
588588
//
589589
// \param N Normal vector of the surface point being shaded.
590-
// \param albedo Single-scattering albedo of the medium.
591-
// \param transmission_depth Distance travelled inside the medium by white light before its color becomes transmission_color by Beer's law.
592-
// Given in scene length units, range [0,infinity). Together with transmission_color this determines the extinction
593-
// coefficient of the medium.
594-
// \param transmission_color Desired color resulting from white light transmitted a distance of 'transmission_depth' through the medium.
595-
// Together with transmission_depth this determines the extinction coefficient of the medium.
590+
// \param albedo Effective albedo of the medium (after multiple scattering). The renderer is expected to invert this color to derive the appropriate single-scattering albedo that will produce this color for the average random walk.
591+
// \param radius Average distance travelled inside the medium per color channel. This is typically taken to be the mean-free path of the volume.
596592
// \param anisotropy Scattering anisotropy [-1,1]. Negative values give backwards scattering, positive values give forward scattering,
597593
// and 0.0 gives uniform scattering.
598594
// \param label Optional string parameter to name this component. For use in AOVs / LPEs.
599595
//
600-
closure color subsurface_bssrdf(normal N, color albedo, float transmission_depth, color transmission_color, float anisotropy) BUILTIN;
596+
closure color subsurface_bssrdf(normal N, color albedo, color radius, float anisotropy) BUILTIN;
601597

602598
// Constructs a microfacet BSDF for the back-scattering properties of cloth-like materials.
603599
// This closure may be vertically layered over a base BSDF, where energy that is not reflected

0 commit comments

Comments
 (0)