Skip to content

Commit bb3f418

Browse files
Update OSL version checks (#2737)
This changelist updates all OSL version checks in the MaterialX data libraries, extending support to OSL versions beyond 1.x.
1 parent fee20a0 commit bb3f418

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

libraries/pbrlib/genosl/mx_chiang_hair_bsdf.osl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ void mx_chiang_hair_bsdf(color tint_R, color tint_TT, color tint_TRT, float ior,
22
vector2 roughness_R, vector2 roughness_TT, vector2 roughness_TRT,
33
float cuticle_angle, vector absorption_coefficient, normal N, vector U, output BSDF bsdf)
44
{
5-
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14
5+
#if (OSL_VERSION_MAJOR == 1 && OSL_VERSION_MINOR >= 14) || (OSL_VERSION_MAJOR > 1)
66
bsdf = chiang_hair_bsdf(N, U, tint_R, tint_TT, tint_TRT, ior,
77
roughness_R.x, roughness_TT.x, roughness_TRT.x, roughness_R.y, roughness_TT.y, roughness_TRT.y,
88
cuticle_angle, absorption_coefficient);

libraries/pbrlib/genosl/mx_subsurface_bsdf.osl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
void mx_subsurface_bsdf(float weight, color albedo, color radius, float anisotropy, normal N, output BSDF bsdf)
22
{
3-
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14
3+
#if (OSL_VERSION_MAJOR == 1 && OSL_VERSION_MINOR >= 14) || (OSL_VERSION_MAJOR > 1)
44
bsdf = weight * subsurface_bssrdf(N, albedo, radius, anisotropy);
55
#else
66
bsdf = weight * subsurface_bssrdf(N, albedo, 1.0, radius, anisotropy);

libraries/stdlib/genosl/mx_image_color3.osl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void mx_image_color3(textureresource file, string layer, color default_value, ve
1616
"subimage", layer, "interp", filtertype,
1717
"missingcolor", missingColor,
1818
"swrap", uaddressmode, "twrap", vaddressmode
19-
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14
19+
#if (OSL_VERSION_MAJOR == 1 && OSL_VERSION_MINOR >= 14) || (OSL_VERSION_MAJOR > 1)
2020
, "colorspace", file.colorspace
2121
#endif
2222
);

libraries/stdlib/genosl/mx_image_color4.osl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ void mx_image_color4(textureresource file, string layer, color4 default_value, v
1818
"subimage", layer, "interp", filtertype,
1919
"missingcolor", missingColor, "missingalpha", missingAlpha,
2020
"swrap", uaddressmode, "twrap", vaddressmode
21-
#if OSL_VERSION_MAJOR >= 1 && OSL_VERSION_MINOR >= 14
21+
#if (OSL_VERSION_MAJOR == 1 && OSL_VERSION_MINOR >= 14) || (OSL_VERSION_MAJOR > 1)
2222
, "colorspace", file.colorspace
2323
#endif
2424
);

0 commit comments

Comments
 (0)