Option to control inlining #221

sambler opened this Issue Jan 8, 2013 · 0 comments


None yet
1 participant

sambler commented Jan 8, 2013

I would like to suggest an addition to control the inlining of functions. While adding inline before each function could be tempting I think the simplicity of osl scripts would work well with a global option.

I suggest something like #pragma inlining on/off could be added near the top of a script to turn it on or off, with the render engine defining which is default.

As an example I have a script of 173 lines - SARock.osl. If you discount the input parameters and the function calls broken into three lines you end up with about 50 real lines of code. Due to it's repetitive nature it compiles to a 7.6MB oso file. I would expect non-inlining to reduce that to less than 1MB. This would also filter through to reduced memory usage when rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment