Open johnfea opened 2 months ago
The problem occurs only when there's this type of usage of closure color:
BSDF = layer(generalized_schlick_bsdf(),BSDF)
So a workaround is to always do this instead:
BSDF = layer(generalized_schlick_bsdf(),BSDF2)
From this one can also speculate what might happen here: base closure pointer is at some point (too late) obtained from the BSDF closure and written into the layer closure, but the BSDF closure is now the layer closure itself instead of the base closure.
This issue results in infinite loop when parsing output closure tree so it definitely needs to be fixed at some point.
Problem
Base closure pointer in osl layer points to its parent layer closure when using batched execute while it should actually point to a diffuse closure.
minimal_test_case.zip
Steps to Reproduce
Download the attached minimal sample and issue the following commands:
g++ -DUSE_BATCHED -mavx2 -mfma -mtune=skylake -mf16c -g test2.cpp -loslcomp -loslexec -loslnoise -loslquery -lOpenImageIO -lOpenImageIO_Util ./a.out parsing mx layer closure parsing generalized schlick closure Error: base closure in mx layer points back to currently parsed closure
g++ -mavx2 -mfma -mtune=skylake -mf16c -g test2.cpp -loslcomp -loslexec -loslnoise -loslquery -lOpenImageIO -lOpenImageIO_Util ./a.out parsing mx layer closure parsing generalized schlick closure parsing diffuse closure <correct output, no problem!>
Here's .osl shader codes in the .zip:
Versions