From 73f5f393f61f4f62dc99fa76d466d1e5d74a7640 Mon Sep 17 00:00:00 2001 From: Jonathan Stone Date: Fri, 20 Dec 2024 15:44:01 -0800 Subject: [PATCH] Updates for OSL shader generation (#2153) This changelist updates OSL shader generation to account for recent feature contributions (e.g. worleynoise, geompropvalueuniform), allowing render comparisons to complete successfully. --- libraries/stdlib/genosl/mx_worleynoise2d_float.osl | 2 +- libraries/stdlib/genosl/mx_worleynoise2d_vector2.osl | 2 +- libraries/stdlib/genosl/mx_worleynoise2d_vector3.osl | 2 +- libraries/stdlib/genosl/mx_worleynoise3d_float.osl | 2 +- libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl | 2 +- libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl | 2 +- source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp | 3 ++- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libraries/stdlib/genosl/mx_worleynoise2d_float.osl b/libraries/stdlib/genosl/mx_worleynoise2d_float.osl index a6289c8a01..bb7615db9f 100644 --- a/libraries/stdlib/genosl/mx_worleynoise2d_float.osl +++ b/libraries/stdlib/genosl/mx_worleynoise2d_float.osl @@ -1,4 +1,4 @@ -void mx_worleynoise2d_float(vector2 texcoord, float jitter, output float result) +void mx_worleynoise2d_float(vector2 texcoord, float jitter, int style, output float result) { result = mx_worley_noise_float(texcoord, jitter, 0); } diff --git a/libraries/stdlib/genosl/mx_worleynoise2d_vector2.osl b/libraries/stdlib/genosl/mx_worleynoise2d_vector2.osl index b523187da0..c96c278cc6 100644 --- a/libraries/stdlib/genosl/mx_worleynoise2d_vector2.osl +++ b/libraries/stdlib/genosl/mx_worleynoise2d_vector2.osl @@ -1,4 +1,4 @@ -void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, output vector2 result) +void mx_worleynoise2d_vector2(vector2 texcoord, float jitter, int style, output vector2 result) { result = mx_worley_noise_vector2(texcoord, jitter, 0); } diff --git a/libraries/stdlib/genosl/mx_worleynoise2d_vector3.osl b/libraries/stdlib/genosl/mx_worleynoise2d_vector3.osl index b5f468a8c9..bd63e23ccc 100644 --- a/libraries/stdlib/genosl/mx_worleynoise2d_vector3.osl +++ b/libraries/stdlib/genosl/mx_worleynoise2d_vector3.osl @@ -1,4 +1,4 @@ -void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, output vector result) +void mx_worleynoise2d_vector3(vector2 texcoord, float jitter, int style, output vector result) { result = mx_worley_noise_vector3(texcoord, jitter, 0); } diff --git a/libraries/stdlib/genosl/mx_worleynoise3d_float.osl b/libraries/stdlib/genosl/mx_worleynoise3d_float.osl index b328fc7522..bfa7e209f7 100644 --- a/libraries/stdlib/genosl/mx_worleynoise3d_float.osl +++ b/libraries/stdlib/genosl/mx_worleynoise3d_float.osl @@ -1,4 +1,4 @@ -void mx_worleynoise3d_float(vector position, float jitter, output float result) +void mx_worleynoise3d_float(vector position, float jitter, int style, output float result) { result = mx_worley_noise_float(position, jitter, 0); } diff --git a/libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl b/libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl index 69c16bbc46..a83e5c4123 100644 --- a/libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl +++ b/libraries/stdlib/genosl/mx_worleynoise3d_vector2.osl @@ -1,4 +1,4 @@ -void mx_worleynoise3d_vector2(vector position, float jitter, output vector2 result) +void mx_worleynoise3d_vector2(vector position, float jitter, int style, output vector2 result) { result = mx_worley_noise_vector2(position, jitter, 0); } diff --git a/libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl b/libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl index d06d1f6bef..34a1540689 100644 --- a/libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl +++ b/libraries/stdlib/genosl/mx_worleynoise3d_vector3.osl @@ -1,4 +1,4 @@ -void mx_worleynoise3d_vector3(vector position, float jitter, output vector result) +void mx_worleynoise3d_vector3(vector position, float jitter, int style, output vector result) { result = mx_worley_noise_vector3(position, jitter, 0); } diff --git a/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp b/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp index 05c83ae82e..a682874126 100644 --- a/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp +++ b/source/MaterialXTest/MaterialXRenderOsl/GenReference.cpp @@ -65,7 +65,8 @@ TEST_CASE("GenReference: OSL Reference", "[genreference]") // Generate reference shaders. // Ignore the following nodes: const mx::StringSet ignoreNodeList = { "surfacematerial", "volumematerial", - "constant_filename", "dot_filename"}; + "constant_filename", "dot_filename", + "geompropvalueuniform_filename" }; bool failedGeneration = false; for (const mx::NodeDefPtr& nodedef : stdlib->getNodeDefs())