Page MenuHome

Cycles: Replace __MAX_CLOSURE__ build option with runtime integrator variable
ClosedPublic

Authored by Mai Lavelle (maiself) on Aug 7 2017, 1:39 PM.

Details

Summary

Goal is to reduce OpenCL kernel recompilations.

Currently viewport renders are still set to use 64 closures as this seems to be faster and we don't want to cause a performance regression there. Needs to be investigated.

Diff Detail

Event Timeline

Seems generally fine. But it's quite odd that only the viewport would have its performance affected? Are we sure the regular render isn't affected as well?

intern/cycles/kernel/split/kernel_split_data.h
35

Maybe use this to make the lines a little shorter in this and the next function:

uint64_t closure_size = sizeof(ShaderClosure) * (kernel_data.integrator.max_closures-1);

Made changes to make likes shorter.

Final render is actually a few percent faster with this, I don't have an explanation.

Looks good to me then.

Also suggesting a small optimization that wasn't possible before.

intern/cycles/kernel/split/kernel_branched.h
37–39

Could we replace kernel_data.integrator.max_closures with branched_state->sd.num_closure here and in the function below, to make it a little faster?

This revision is now accepted and ready to land.Aug 12 2017, 2:47 PM
This revision was automatically updated to reflect the committed changes.