Blender Git Commit Log

Git Commits -> Revision f613c4c

Revision f613c4c by Michael Jones (master)
November 29, 2021, 15:20 (GMT)
Cycles: MetalRT support (kernel side)

This patch adds MetalRT support to Cycles kernel code. It is mostly additive in nature or confined to Metal-specific code, however there are a few areas where this interacts with other code:

- MetalRT closely follows the Optix implementation, and in some cases (notably handling of transforms) it makes sense to extend Optix special-casing to MetalRT. For these generalisations we now have `__KERNEL_GPU_RAYTRACING__` instead of `__KERNEL_OPTIX__`.
- MetalRT doesn't support primitive offsetting (as with `primitiveIndexOffset` in Optix), so we define and populate a new kernel texture, `__object_prim_offset`, containing per-object primitive / curve-segment offsets. This is referenced and applied in MetalRT intersection handlers.
- Two new BVH layout enum values have been added: `BVH_LAYOUT_METAL` and `BVH_LAYOUT_MULTI_METAL_EMBREE` for XPU mode). Some host-side enum case handling has been updated where it is trivial to do so.

Ref T92212

Reviewed By: brecht

Maniphest Tasks: T92212

Differential Revision: https://developer.blender.org/D13353

Commit Details:

Full Hash: f613c4c0953ebaf993ecd55b12bab9cf2196dac4
Parent Commit: 98a5c92
Lines Changed: +1010, -32

1 Added Path:

/intern/cycles/kernel/bvh/metal.h (+47, -0) (View)

23 Modified Paths:

/intern/cycles/bvh/bvh.cpp (+6, -0) (Diff)
/intern/cycles/device/cpu/device_impl.cpp (+2, -1) (Diff)
/intern/cycles/device/multi/device.cpp (+6, -1) (Diff)
/intern/cycles/kernel/bvh/bvh.h (+289, -6) (Diff)
/intern/cycles/kernel/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/kernel/device/gpu/kernel.h (+2, -0) (Diff)
/intern/cycles/kernel/device/metal/compat.h (+28, -1) (Diff)
/intern/cycles/kernel/device/metal/context_begin.h (+4, -0) (Diff)
/intern/cycles/kernel/device/metal/kernel.metal (+559, -3) (Diff)
/intern/cycles/kernel/device/optix/compat.h (+1, -0) (Diff)
/intern/cycles/kernel/geom/motion_triangle_intersect.h (+2, -2) (Diff)
/intern/cycles/kernel/geom/triangle_intersect.h (+2, -2) (Diff)
/intern/cycles/kernel/integrator/subsurface_disk.h (+2, -2) (Diff)
/intern/cycles/kernel/integrator/subsurface_random_walk.h (+3, -3) (Diff)
/intern/cycles/kernel/textures.h (+1, -0) (Diff)
/intern/cycles/kernel/types.h (+7, -3) (Diff)
/intern/cycles/scene/geometry.cpp (+4, -2) (Diff)
/intern/cycles/scene/object.cpp (+29, -0) (Diff)
/intern/cycles/scene/object.h (+1, -0) (Diff)
/intern/cycles/scene/scene.cpp (+7, -0) (Diff)
/intern/cycles/scene/scene.h (+1, -0) (Diff)
/intern/cycles/util/math_float3.h (+2, -2) (Diff)
/intern/cycles/util/transform.h (+4, -4) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021