<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div>I did some quick tests to empirically test the hypothesis that osl performance is made much worse by texture filtering or translation of structures. <br>
<br>
</div>First texture filtering:<br><br></div>I made a scene with a plane, a camera and an environment of a solid color:<br><br></div>I added a texture and measured:<br><br></div>svm:          OSL:        modified OSL:<br>
<br>
0:12:40      0:27:72     0:26:60<br>0:12:40      0:27:90     0:26:75<br>0:12:40      0:28:03     0:26:53<br><br></div>modified OSL is a one line change to force bi-linear texture interpolation:<br><br>intern/cycles/kernel/osl/osl_services.cpp: ~ line 772 add:<br>

options.interpmode = TextureOpt::InterpBilinear;<br><br></div>I am getting what looks like a measurable significant result but no where near what we need to explain performance gap.<br><br></div>Diffuse:<br><br></div>svm:          OSL:<br>

0:09:10      0:11:25<br>0:09:10      0:11:17<br>0:09:08      0:11:17<br><br></div>noise texture<br><br></div>svm:          OSL:<br>0:17:02      0:23:18<br>0:16:97      0:23:00<br>0:16:98      0:22:96<br><br></div>both of the above are in line with each other both would indicate a performance loss of about 25 % on using OSL for trivial shaders due to translation of data, OSL initialization etc. <br>
<br></div>To me it seems that image textures are getting a huge hit and that the SmartBicubic filter is not the main problem. <br><br></div>Hope this info helps. I am continuing the dig to find the root cause.<br><div><div>
<div><div><div><br><br><br></div></div></div></div></div></div>