imageworks/OpenShadingLanguage — pull request #430 by lgritz (2014-11-14 01:21:32+00:00)
Title: Allow renderer outputs to be specified as "layer.param".

This allows you to designate a named output to be a "renderer output" (thus immune from unused output elision, among other things) only if it is part of a particular layer, if you so desire. Of course, you can just give a plain unqualified name, too, which would designate ANY outputs of the same name (in any layer) as being so preserved, as it always has worked.

As an example, this may come in handy if you have shader group where a bunch of the instances have output parameters named "Cout", but only a particular one is designated as needing to be queried by the renderer after shader execution (so the others may be free to be optimized away).

Because this makes the instance->is_renderer_output() test much more expensive (because it needs to concatenate the string), we also refactor slightly so the "is it an output" test is done just once for each instance param at the start of runtime optimization, the result stored in a bit in the Symbol struct, so can be very easily tested the zillions of times the optimizer may need to know.