Individual layer execution
The "all in one shot" approach still works just fine, and is probably the usual way of doing things. But for renderer that need even more control over which layers are executed and when, this provides an alternate calling sequence that gives more flexibility.
On Oct 13, 2022, at 3:40 PM, Larry Gritz <lg@...> wrote:Per today's TSC meeting...The PR that originally added the per-layer execution is this one from 2015: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/553Unfortunately, though this has "now you can do this if you need the flexibility" explanation, it ultimately does not spell out a use case or say whose request it was that it be added. This is as close as we get:The "all in one shot" approach still works just fine, and is probably the usual way of doing things. But for renderer that need even more control over which layers are executed and when, this provides an alternate calling sequence that gives more flexibility.Our renderer just uses the "one-shot" approach. At this time, I cannot think of a good use case for the renderer taking control of individual layer execution. I honestly don't remember why we did this.Since it's just unnecessary complication, and has no useful corresponding functionality on the GPU, my current recommendation is that we mark execute_init(), execute_layer() and execute_cleanup() as deprecated in the main branch, even on the CPU, and move toward eventually phasing them out and capitalizing on any simplifications that result.
Per today's TSC meeting...The PR that originally added the per-layer execution is this one from 2015: https://github.com/AcademySoftwareFoundation/OpenShadingLanguage/pull/553Unfortunately, though this has "now you can do this if you need the flexibility" explanation, it ultimately does not spell out a use case or say whose request it was that it be added. This is as close as we get:The "all in one shot" approach still works just fine, and is probably the usual way of doing things. But for renderer that need even more control over which layers are executed and when, this provides an alternate calling sequence that gives more flexibility.Our renderer just uses the "one-shot" approach. At this time, I cannot think of a good use case for the renderer taking control of individual layer execution. I honestly don't remember why we did this.Since it's just unnecessary complication, and has no useful corresponding functionality on the GPU, my current recommendation is that we mark execute_init(), execute_layer() and execute_cleanup() as deprecated in the main branch, even on the CPU, and move toward eventually phasing them out and capitalizing on any simplifications that result.
We use execute_layer to execute a subset of a shaderGroup.
For instance we can have the displacement and the material defined in the same graph, and they can share some branches. But we don't want to evaluate the material part when we compute the displace.
If it's a burden to maintain we can think of another solution, but execute layer is quite useful for this use case.
Cheers,
Thomas METAIS
Correct me when (not if) I'm wrong, but wouldn't compiling your shader graph twice, once only asking for the displacement output, and once asking for the material outputs, give you the same thing, indvidually optimized? Might even end up being more run-time efficient (but slightly less compile time efficient)?
/Z
Correct me when (not if) I'm wrong, but wouldn't compiling your shader graph twice, once only asking for the displacement output, and once asking for the material outputs, give you the same thing, indvidually optimized? Might even end up being more run-time efficient (but slightly less compile time efficient)?
/Z
Thats exactly what we do zap, we see two smaller and faster materials.On Wed, Oct 19, 2022 at 12:09 AM Zap Andersson via lists.aswf.io <zap.andersson=autodesk.com@...> wrote:Correct me when (not if) I'm wrong, but wouldn't compiling your shader graph twice, once only asking for the displacement output, and once asking for the material outputs, give you the same thing, indvidually optimized? Might even end up being more run-time efficient (but slightly less compile time efficient)?
/Z