9 # include <Metal/Metal.h>
16 METALRT_FUNC_DEFAULT_TRI,
17 METALRT_FUNC_DEFAULT_BOX,
18 METALRT_FUNC_SHADOW_TRI,
19 METALRT_FUNC_SHADOW_BOX,
20 METALRT_FUNC_LOCAL_TRI,
21 METALRT_FUNC_LOCAL_BOX,
22 METALRT_FUNC_CURVE_RIBBON,
23 METALRT_FUNC_CURVE_RIBBON_SHADOW,
24 METALRT_FUNC_CURVE_ALL,
25 METALRT_FUNC_CURVE_ALL_SHADOW,
27 METALRT_FUNC_POINT_SHADOW,
31 enum { METALRT_TABLE_DEFAULT, METALRT_TABLE_SHADOW, METALRT_TABLE_LOCAL, METALRT_TABLE_NUM };
34 enum MetalPipelineType {
46 PSO_SPECIALIZED_INTERSECT,
52 PSO_SPECIALIZED_SHADE,
57 # define METALRT_FEATURE_MASK \
58 (KERNEL_FEATURE_HAIR | KERNEL_FEATURE_HAIR_THICK | KERNEL_FEATURE_POINTCLOUD | \
59 KERNEL_FEATURE_OBJECT_MOTION)
61 const char *kernel_type_as_string(MetalPipelineType pso_type);
63 struct MetalKernelPipeline {
67 id<MTLLibrary> mtlLibrary = nil;
68 MetalPipelineType pso_type;
70 size_t usage_count = 0;
76 int threads_per_threadgroup;
80 id<MTLDevice> mtlDevice = nil;
81 id<MTLFunction>
function = nil;
82 id<MTLComputePipelineState> pipeline = nil;
83 int num_threads_per_block = 0;
85 bool should_use_binary_archive()
const;
89 API_AVAILABLE(macos(11.0))
90 id<MTLIntersectionFunctionTable> intersection_func_table[METALRT_TABLE_NUM] = {nil};
91 id<MTLFunction> rt_intersection_function[METALRT_FUNC_NUM] = {nil};
95 namespace MetalDeviceKernels {
97 bool should_load_kernels(MetalDevice *device, MetalPipelineType pso_type);
98 bool load(MetalDevice *device, MetalPipelineType pso_type);
99 const MetalKernelPipeline *get_best_pipeline(
const MetalDevice *device,
DeviceKernel kernel);
#define CCL_NAMESPACE_END
SyclQueue void void size_t num_bytes SyclQueue void const char void *memory_device_pointer KernelContext int kernel