mitsuba-renderer / drjit

Dr.Jit — A Just-In-Time-Compiler for Differentiable Rendering
BSD 3-Clause "New" or "Revised" License
601 stars 45 forks source link

call_support: allow override of the Domain #307

Closed merlinND closed 3 weeks ago

merlinND commented 1 month ago

This PR lets users of DRJIT_CALL_* macros specify a domain_ static constexpr method to override the domain name, e.g. based on some of the template parameters.

This is used in this Mitsuba PR: https://github.com/mitsuba-renderer/mitsuba3/pull/1362 If we find an easier way to fix the Mitsuba issue, then this change would no longer be needed.

njroussel commented 1 month ago

This seems fine, an alternative would be to overload the DRJIT_CALL_BEGIN macro to take two arguments: the class name and the domain name.

Let's avoid the double leading underscore in __domain() - it's usually reserved for the compiler :)

merlinND commented 1 month ago

overload the DRJIT_CALL_BEGIN macro to take two arguments: the class name and the domain name.

I thought about that, but since the domain name needs to be computed based on template arguments that are only provided once the call_support struct is instantiated, I don't think we could give the domain name as a macro argument.

njroussel commented 1 month ago

Oh yes, indeed :/