Page MenuHome

Cycles: Several small fixes and additions for MSL
ClosedPublic

Authored by Michael Jones (michael_jones) on Nov 17 2021, 3:37 PM.

Details

Summary

This patch contains many small leftover fixes and additions that are required for Metal-enablement:

  • Address space fixes and a few other small compile fixes
  • Addition of missing functionality to the Metal adapter headers
  • Addition of various scattered __KERNEL_METAL__ blocks (e.g. for atomic support & maths functions)

Ref T92212

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 18740
Build 18740: arc lint + arc unit

Event Timeline

Michael Jones (michael_jones) requested review of this revision.Nov 17 2021, 3:37 PM
Michael Jones (michael_jones) created this revision.
Brecht Van Lommel (brecht) requested changes to this revision.Nov 17 2021, 4:14 PM

Looks generally fine.

intern/cycles/kernel/geom/attribute.h
31

I'd prefer to move the definition here rather than make this metal specific.

intern/cycles/kernel/sample/lcg.h
22

Would be helpful to add a comment this is templated to handle multiple address spaces.

intern/cycles/kernel/sample/pattern.h
166–179

We should add a popcount in util/math.h rather than doing more device specific things here.

intern/cycles/util/half.h
33

float4_store_half was removed for other devices, this should no longer be needed.

57

This also is not defined for other devices.

This revision now requires changes to proceed.Nov 17 2021, 4:14 PM
  • Add popcount in util/math.h, and use instead of ccl_gpu_popc
  • Remove unused half util functions
  • Add comment about templating to handle multiple address spaces
  • Move definition of subd_triangle_patch instead of a forward declare
Michael Jones (michael_jones) marked 5 inline comments as done.Nov 17 2021, 10:52 PM

Thank you for the suggestions @Brecht Van Lommel (brecht) - I have updated the patch accordingly.

  • Use uint instead of int in popcount, and use ccl_device_inline macro

Looks fine to me now, I'll commit this along with D13241.

This revision is now accepted and ready to land.Nov 18 2021, 2:57 PM