21 PG_RGEN_INTERSECT_CLOSEST,
22 PG_RGEN_INTERSECT_SHADOW,
23 PG_RGEN_INTERSECT_SUBSURFACE,
24 PG_RGEN_INTERSECT_VOLUME_STACK,
25 PG_RGEN_INTERSECT_DEDICATED_LIGHT,
26 PG_RGEN_SHADE_BACKGROUND,
28 PG_RGEN_SHADE_SURFACE,
29 PG_RGEN_SHADE_SURFACE_RAYTRACE,
30 PG_RGEN_SHADE_SURFACE_MNEE,
33 PG_RGEN_SHADE_DEDICATED_LIGHT,
34 PG_RGEN_EVAL_DISPLACE,
35 PG_RGEN_EVAL_BACKGROUND,
36 PG_RGEN_EVAL_CURVE_SHADOW_TRANSPARENCY,
51static const int MISS_PROGRAM_GROUP_OFFSET = PG_MISS;
52static const int NUM_MISS_PROGRAM_GROUPS = 1;
53static const int HIT_PROGAM_GROUP_OFFSET = PG_HITD;
54static const int NUM_HIT_PROGRAM_GROUPS = 8;
55static const int CALLABLE_PROGRAM_GROUPS_BASE = PG_CALL_SVM_AO;
56static const int NUM_CALLABLE_PROGRAM_GROUPS = 2;
59enum { PIP_SHADE, PIP_INTERSECT, NUM_PIPELINES };
63 char header[OPTIX_SBT_RECORD_HEADER_SIZE];
66class OptiXDevice :
public CUDADevice {
68 OptixDeviceContext context =
NULL;
70 OptixModule optix_module =
NULL;
71 OptixModule builtin_modules[2] = {};
72 OptixPipeline pipelines[NUM_PIPELINES] = {};
73 OptixProgramGroup groups[NUM_PROGRAM_GROUPS] = {};
74 OptixPipelineCompileOptions pipeline_options = {};
80 OSLGlobals osl_globals;
86 OptixTraversableHandle tlas_handle = 0;
96 string compile_kernel_get_common_cflags(
const uint kernel_features);
98 bool load_kernels(
const uint kernel_features)
override;
100 bool load_osl_kernels()
override;
102 bool build_optix_bvh(BVHOptiX *bvh,
103 OptixBuildOperation operation,
104 const OptixBuildInput &build_input,
109 void release_bvh(
BVH *bvh)
override;
110 void free_bvh_memory_delayed();
112 void const_copy_to(
const char *name,
void *host,
size_t size)
override;
114 void update_launch_params(
size_t offset,
void *data,
size_t data_size);
116 virtual unique_ptr<DeviceQueue> gpu_queue_create()
override;
118 void *get_cpu_osl_memory()
override;
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN typedef std::mutex thread_mutex