shader-slang / slang

Making it easier to work with shaders
MIT License
1.78k stars 159 forks source link

AD Cleanup: Fix inconsistency between `ForwardDerivativeDecoration` and `UserDefinedBackwardDerivativeDecoration` #4469

Open saipraveenb25 opened 4 days ago

saipraveenb25 commented 4 days ago

Our decoration naming and usage is rather messy, mostly because we rewrote it several times. The most glaring part is where we have a single decoration ForwardDerivativeDecoration to hold user-provided forward derivatives but two UserDefinedBackwardDerivativeDecoration and BackwardDerivativeDecoration, for the reverse mode. We should simply be able to remove UserDefinedBackwardDerivativeDecoration and cut down on code duplication & confusion.