-
Notifications
You must be signed in to change notification settings - Fork 264
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
Frozen Function Support #1477
base: master
Are you sure you want to change the base?
Frozen Function Support #1477
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -368,6 +368,30 @@ extern "C" { | |||||
}) | ||||||
#endif | ||||||
|
||||||
#define MI_DECLARE_TRAVERSE_CB() \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alignment of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we already discussed this, but I really wish there was a way to have the fields listed in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to have this called automatically by |
||||||
public: \ | ||||||
void traverse_1_cb_ro(void *payload, \ | ||||||
drjit::detail::traverse_callback_ro fn) \ | ||||||
const override; \ | ||||||
void traverse_1_cb_rw( \ | ||||||
void *payload, drjit::detail::traverse_callback_rw fn) override; | ||||||
|
||||||
#define MI_IMPLEMENT_TRAVERSE_CB(Type, Base, ...) \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, could this be called by |
||||||
MI_VARIANT \ | ||||||
void Type<Float, Spectrum>::traverse_1_cb_ro( \ | ||||||
void *payload, drjit::detail::traverse_callback_ro fn) const { \ | ||||||
if constexpr (!std ::is_same_v<Base, drjit ::TraversableBase>) \ | ||||||
Base ::traverse_1_cb_ro(payload, fn); \ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
and also below. |
||||||
DRJIT_MAP(DR_TRAVERSE_MEMBER_RO, __VA_ARGS__) \ | ||||||
} \ | ||||||
MI_VARIANT \ | ||||||
void Type<Float, Spectrum>::traverse_1_cb_rw( \ | ||||||
void *payload, drjit::detail::traverse_callback_rw fn) { \ | ||||||
if constexpr (!std ::is_same_v<Base, drjit ::TraversableBase>) \ | ||||||
Base ::traverse_1_cb_rw(payload, fn); \ | ||||||
DRJIT_MAP(DR_TRAVERSE_MEMBER_RW, __VA_ARGS__) \ | ||||||
} | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should add an alias for The two |
||||||
//! @} | ||||||
// ============================================================= | ||||||
|
||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -609,6 +609,8 @@ class MI_EXPORT_LIB BSDF : public Object { | |
|
||
/// Identifier (if available) | ||
std::string m_id; | ||
|
||
DR_TRAVERSE_CB(Object); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to use |
||
}; | ||
|
||
// ----------------------------------------------------------------------- | ||
|
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.