Page MenuHome

Cycles: Generate OSL closures using macros and a template file
ClosedPublic

Authored by Patrick Mours (pmoursnv) on Sep 8 2022, 7:32 PM.

Details

Summary

This has the advantage of being able to use information about the
existing OSL closures in various places without code duplication. In
addition, the setup code for all closures was moved to standalone
functions to avoid usage of virtual function calls in preparation for GPU
support.

This patch was split off from D15902.

Diff Detail

Repository
rB Blender

Event Timeline

Patrick Mours (pmoursnv) requested review of this revision.Sep 8 2022, 7:32 PM
Patrick Mours (pmoursnv) created this revision.
Brecht Van Lommel (brecht) added inline comments.
intern/cycles/kernel/osl/shader.cpp
161

It seems OSL_SUPPORTS_WEIGHTED_CLOSURE_COMPONENTS is from 2013 so indeed it should be fine to no longer check that.

386–387

Same comment.

intern/cycles/kernel/osl/shader.h
56–57

This seems to have leaked in from D15918, leave this out when committing.

This revision is now accepted and ready to land.Sep 8 2022, 8:04 PM
intern/cycles/kernel/osl/shader.h
56–57

OSLShader::find_attribute is not actually used anywhere, so can safely be removed either way. Had it included here too to be able to get rid of the #include "scene/attribute.h" in shader.cpp, but agree it's probably cleaner to do that as part of D15918.