24 PG_RGEN_INTERSECT_CLOSEST,
25 PG_RGEN_INTERSECT_SHADOW,
26 PG_RGEN_INTERSECT_SUBSURFACE,
27 PG_RGEN_INTERSECT_VOLUME_STACK,
28 PG_RGEN_INTERSECT_DEDICATED_LIGHT,
29 PG_RGEN_SHADE_BACKGROUND,
31 PG_RGEN_SHADE_SURFACE,
32 PG_RGEN_SHADE_SURFACE_RAYTRACE,
33 PG_RGEN_SHADE_SURFACE_MNEE,
36 PG_RGEN_SHADE_DEDICATED_LIGHT,
37 PG_RGEN_EVAL_DISPLACE,
38 PG_RGEN_EVAL_BACKGROUND,
39 PG_RGEN_EVAL_CURVE_SHADOW_TRANSPARENCY,
40 PG_RGEN_INIT_FROM_CAMERA,
66static const int MISS_PROGRAM_GROUP_OFFSET = PG_MISS;
67static const int NUM_MISS_PROGRAM_GROUPS = 1;
68static const int HIT_PROGAM_GROUP_OFFSET = PG_HITD;
69static const int NUM_HIT_PROGRAM_GROUPS = 12;
70static const int CALLABLE_PROGRAM_GROUPS_BASE = PG_CALL_SVM_AO;
71static const int NUM_CALLABLE_PROGRAM_GROUPS = 2;
74enum { PIP_SHADE, PIP_INTERSECT, NUM_PIPELINES };
78 char header[OPTIX_SBT_RECORD_HEADER_SIZE];
81class OptiXDevice :
public CUDADevice {
83 OptixDeviceContext
context =
nullptr;
85 OptixModule optix_module =
nullptr;
86 OptixModule builtin_modules[2] = {};
87 OptixPipeline pipelines[NUM_PIPELINES] = {};
88 OptixProgramGroup groups[NUM_PROGRAM_GROUPS] = {};
89 OptixPipelineCompileOptions pipeline_options = {};
92 OSLGlobals osl_globals;
95 OptixModule osl_camera_module =
nullptr;
103 OptixTraversableHandle tlas_handle = 0;
109 ~OptiXDevice()
override;
113 string compile_kernel_get_common_cflags(
const uint kernel_features);
115 void create_optix_module(
TaskPool &pool,
116 OptixModuleCompileOptions &module_options,
119 OptixResult &failure_reason);
121 bool load_kernels(
const uint kernel_features)
override;
123 bool load_osl_kernels()
override;
125 bool build_optix_bvh(BVHOptiX *bvh,
126 OptixBuildOperation operation,
127 const OptixBuildInput &build_input,
132 void release_bvh(
BVH *bvh)
override;
133 void free_bvh_memory_delayed();
135 void const_copy_to(
const char *
name,
void *host,
const size_t size)
override;
137 void update_launch_params(
const size_t offset,
void *
data,
const size_t data_size);
139 unique_ptr<DeviceQueue> gpu_queue_create()
override;
141 OSLGlobals *get_cpu_osl_memory()
override;
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
#define CCL_NAMESPACE_END
int context(const bContext *C, const char *member, bContextDataResult *result)
static struct PyModuleDef module