imageworks/OpenShadingLanguage — pull request #386 by lgritz (2014-06-26 02:02:03+00:00)
Title: Allow per-shader-group outputs (which will not be optimized away).

Previously, the "string[] renderer_outputs" attribute was a global (for
the whole shading system) list of render output names (aka "AOVs"),
having the primary effect that they would not be elided during shader
optimization, even if they were not explicitly connected to downstream
shaders.

This patch adds (additionally) a per-shader-group attribute of the same
name and purpose, so you could designate group-specific output names.
Every place where the optimizer previously checked the global list, it
now also checks the list for the specific group it is optimizing.

This is really useful for apps that use OSL as a computation engine or
pattern language, where the primary output is not Ci or other standard
OSL "global variables," and where furthermore you may want a different
set of named outputs for each group, so no global (ShadingSystem-wide)
list will suffice.

Apps or renderers that do not have this problem may continue just using
the old attribute, and need not set the renderer outputs for each group
individually.