Page MenuHome

Cycles: Adapt volumetric lambda functions to work on MSL
ClosedPublic

Authored by Michael Jones (michael_jones) on Nov 16 2021, 10:55 AM.

Details

Summary

This patch adapts the existing volumetric read/write lambda functions for Metal. Lambda expressions are not supported on MSL, so two new macros VOLUME_READ_LAMBDA and VOLUME_WRITE_LAMBDA have been defined with a default implementation which, on Metal, is overridden to use inline function objects.

This patch also removes the last remaining mention of the now-unused ccl_addr_space.

Ref T92212

Diff Detail

Repository
rB Blender
Branch
arcpatch-D13234 (branched from master)
Build Status
Buildable 18685
Build 18685: arc lint + arc unit

Event Timeline

Michael Jones (michael_jones) requested review of this revision.Nov 16 2021, 10:55 AM
Michael Jones (michael_jones) created this revision.
  • Revert change to local path_flag type

Seems to work fine for me and the code looks fine. Why are you moving the lambdas behind macros is it so you can get it to work with Metal?

This revision is now accepted and ready to land.Nov 16 2021, 1:48 PM

Seems to work fine for me and the code looks fine. Why are you moving the lambdas behind macros is it so you can get it to work with Metal?

Yes, lambda expressions are not available in Metal, but we can achieve the same result using function-style objects which can be passed to templated functions the same way as lambda expressions.