@@ -33,11 +33,13 @@ cdef extern from "optix.h" nogil:
3333 float timeBegin
3434 float timeEnd
3535
36+
3637 cdef struct OptixAccelBuildOptions:
3738 unsigned int buildFlags
3839 OptixBuildOperation operation
3940 OptixMotionOptions motionOptions
4041
42+
4143 cdef enum OptixBuildInputType:
4244 OPTIX_BUILD_INPUT_TYPE_TRIANGLES,
4345 OPTIX_BUILD_INPUT_TYPE_CUSTOM_PRIMITIVES,
@@ -51,6 +53,7 @@ cdef extern from "optix.h" nogil:
5153 CUdeviceptr instances
5254 unsigned int numInstances
5355
56+
5457 cdef struct OptixAabb:
5558 float minX
5659 float minY
@@ -59,6 +62,7 @@ cdef extern from "optix.h" nogil:
5962 float maxY
6063 float maxZ
6164
65+
6266 cdef struct OptixBuildInputCustomPrimitiveArray:
6367 const CUdeviceptr * aabbBuffers
6468 unsigned int numPrimitives
@@ -70,6 +74,7 @@ cdef extern from "optix.h" nogil:
7074 unsigned int sbtIndexOffsetStrideInBytes
7175 unsigned int primitiveIndexOffset
7276
77+
7378 IF _OPTIX_VERSION_MAJOR == 7 and _OPTIX_VERSION_MINOR > 4 : # switch to new instance flags
7479 cdef enum OptixPrimitiveType:
7580 OPTIX_PRIMITIVE_TYPE_CUSTOM,
@@ -95,11 +100,13 @@ cdef extern from "optix.h" nogil:
95100 OPTIX_PRIMITIVE_TYPE_ROUND_LINEAR,
96101 OPTIX_PRIMITIVE_TYPE_TRIANGLE,
97102
103+
98104 IF _OPTIX_VERSION_MAJOR == 7 and _OPTIX_VERSION_MINOR > 3 : # switch to new instance flags
99105 cdef enum OptixCurveEndcapFlags:
100106 OPTIX_CURVE_ENDCAP_DEFAULT,
101107 OPTIX_CURVE_ENDCAP_ON
102108
109+
103110 cdef struct OptixBuildInputCurveArray:
104111 OptixPrimitiveType curveType
105112 unsigned int numPrimitives
@@ -131,11 +138,13 @@ cdef extern from "optix.h" nogil:
131138 unsigned int flag
132139 unsigned int primitiveIndexOffset
133140
141+
134142 cdef enum OptixIndicesFormat:
135143 OPTIX_INDICES_FORMAT_NONE,
136144 OPTIX_INDICES_FORMAT_UNSIGNED_SHORT3,
137145 OPTIX_INDICES_FORMAT_UNSIGNED_INT3
138146
147+
139148 cdef enum OptixVertexFormat:
140149 OPTIX_VERTEX_FORMAT_NONE,
141150 OPTIX_VERTEX_FORMAT_FLOAT3,
@@ -145,11 +154,13 @@ cdef extern from "optix.h" nogil:
145154 OPTIX_VERTEX_FORMAT_SNORM16_3,
146155 OPTIX_VERTEX_FORMAT_SNORM16_2
147156
157+
148158 cdef enum OptixTransformFormat:
149159 OPTIX_TRANSFORM_FORMAT_NONE,
150160 OPTIX_TRANSFORM_FORMAT_MATRIX_FLOAT12,
151161
152- IF _OPTIX_VERSION_MAJOR == 7 and _OPTIX_VERSION_MINOR > 4 : # switch to new geometry flags
162+
163+ IF _OPTIX_VERSION > 70400 : # switch to new geometry flags
153164 cdef enum OptixGeometryFlags:
154165 OPTIX_GEOMETRY_FLAG_NONE,
155166 OPTIX_GEOMETRY_FLAG_DISABLE_ANYHIT,
@@ -179,7 +190,8 @@ cdef extern from "optix.h" nogil:
179190 unsigned int primitiveIndexOffset
180191 OptixTransformFormat transformFormat
181192
182- IF _OPTIX_VERSION_MAJOR == 7 and _OPTIX_VERSION_MINOR > 4 : # switch to new geometry flags
193+
194+ IF _OPTIX_VERSION > 70400 : # switch to new geometry flags
183195 cdef struct OptixBuildInputSphereArray:
184196 const CUdeviceptr* vertexBuffers
185197 unsigned int vertexStrideInBytes
@@ -211,24 +223,30 @@ cdef extern from "optix.h" nogil:
211223 OptixBuildInputCustomPrimitiveArray customPrimitiveArray
212224 OptixBuildInputInstanceArray instanceArray
213225
226+
214227 cdef struct OptixAccelBufferSizes:
215228 size_t outputSizeInBytes
216229 size_t tempSizeInBytes
217230 size_t tempUpdateSizeInBytes
218231
232+
219233 cdef enum OptixAccelPropertyType:
220234 OPTIX_PROPERTY_TYPE_COMPACTED_SIZE,
221235 OPTIX_PROPERTY_TYPE_AABBS,
222236
237+
223238 cdef struct OptixAccelEmitDesc:
224239 CUdeviceptr result
225240 OptixAccelPropertyType type
226241
242+
227243 ctypedef uintptr_t OptixTraversableHandle
228244
245+
229246 cdef struct OptixAccelRelocationInfo:
230247 unsigned long long info[4 ]
231248
249+
232250 cdef enum OptixTraversableType:
233251 OPTIX_TRAVERSABLE_TYPE_STATIC_TRANSFORM,
234252 OPTIX_TRAVERSABLE_TYPE_MATRIX_MOTION_TRANSFORM,
@@ -341,6 +359,7 @@ cdef class BuildInputCurveArray(BuildInputArray):
341359 cdef vector[CUdeviceptr] _d_normal_buffer_ptrs
342360 cdef object _d_index_buffer
343361
362+
344363IF _OPTIX_VERSION > 70400 :
345364 cdef class BuildInputSphereArray(BuildInputArray):
346365 cdef OptixBuildInputSphereArray build_input
@@ -351,6 +370,7 @@ IF _OPTIX_VERSION > 70400:
351370 cdef object _d_sbt_offset_buffer
352371 cdef vector[unsigned int ] _flags
353372
373+
354374cdef class Instance(OptixObject):
355375 cdef OptixInstance instance
356376 cdef AccelerationStructure _traversable
0 commit comments