-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for exporting metadata in shader generation (#371) #435
Support for exporting metadata in shader generation (#371) #435
Conversation
* Add implemention of AttributeDef element. * Added AttributeDef pointer types * Support [[ ]] punctuations for scope begin/end. * Fixed issue with boolean type in OSL. * Add metadata to ShaderPort. Support generation of metadata for shader inputs. * Added AttributeDef methods to document. * Fixed bug with scope handling in shader generation * Using AttributeDefs for registering shader metadata. * Support for metadata on node level. * Added unittest for metadata generation. * Fix typo in standard_surface nodedef. * Support input widget metadata. * Code cleanup. * Fix initialization order issue.
|
||
/// @class GenUserData | ||
/// Base class for custom user data needed during shader generation. | ||
class GenUserData : public std::enable_shared_from_this<GenUserData> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved out to a separate file.
/// Derived shader generators may override this method to change the registration. | ||
/// Applications must explicitly call this method before shader generation to enable | ||
/// export of metadata. | ||
virtual void registerShaderMetadata(const DocumentPtr& doc, GenContext& context) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling this method on the GenContext will enable export for shader metadata, according to which attributedefs are defined and/or which metadata this shader generator allows if the method is overridden.
Looks good, thanks @niklasharrysson! |
This change list adds support for exporting shader metadata in shader generation, as well as addresses a couple of other issues: