27 #ifndef __optix_optixu_h__
28 #define __optix_optixu_h__
34 # define RTU_INLINE inline
37 # define RTU_INLINE __inline
39 # define RTU_INLINE static inline
86 RTresult RTAPI
rtuCUDACompileString(
const char* source,
const char** preprocessorArguments,
unsigned int numPreprocessorArguments, RTsize* resultSize, RTsize* errorSize );
101 RTresult RTAPI
rtuCUDACompileFile(
const char* filename,
const char** preprocessorArguments,
unsigned int numPreprocessorArguments, RTsize* resultSize, RTsize* errorSize );
212 #define RTU_CHECK_ERROR( func ) \
214 RTresult code = func; \
215 if( code != RT_SUCCESS ) \
219 #define RTU_GROUP_ADD_CHILD( _parent, _child, _index ) \
220 unsigned int _count; \
221 RTU_CHECK_ERROR( rtGroupGetChildCount( (_parent), &_count ) ); \
222 RTU_CHECK_ERROR( rtGroupSetChildCount( (_parent), _count+1 ) ); \
223 RTU_CHECK_ERROR( rtGroupSetChild( (_parent), _count, (_child) ) ); \
224 if( _index ) *(_index) = _count; \
227 #define RTU_SELECTOR_ADD_CHILD( _parent, _child, _index ) \
228 unsigned int _count; \
229 RTU_CHECK_ERROR( rtSelectorGetChildCount( (_parent), &_count ) ); \
230 RTU_CHECK_ERROR( rtSelectorSetChildCount( (_parent), _count+1 ) ); \
231 RTU_CHECK_ERROR( rtSelectorSetChild( (_parent), _count, (_child) ) ); \
232 if( _index ) *(_index) = _count; \
240 RTU_GROUP_ADD_CHILD( group, child, index );
245 RTU_SELECTOR_ADD_CHILD( selector, child, index );
252 RTU_GROUP_ADD_CHILD( group, child, index );
257 RTU_GROUP_ADD_CHILD( group, child, index );
262 RTU_GROUP_ADD_CHILD( group, child, index );
267 RTU_GROUP_ADD_CHILD( group, child, index );
272 RTU_SELECTOR_ADD_CHILD( selector, child, index );
277 RTU_SELECTOR_ADD_CHILD( selector, child, index );
282 RTU_SELECTOR_ADD_CHILD( selector, child, index );
287 RTU_SELECTOR_ADD_CHILD( selector, child, index );
292 #undef RTU_GROUP_ADD_CHILD
293 #undef RTU_SELECTOR_ADD_CHILD
349 if( index ) *index = count;
415 for( *index=0; *index<count; (*index)++ ) {
428 for( *index=0; *index<count; (*index)++ ) {
441 for( *index=0; *index<count; (*index)++ ) {
481 unsigned int usePTX32InHost64,
483 unsigned int num_verts,
485 unsigned int num_tris,
486 const unsigned* indices,
487 const unsigned* mat_indices);
525 unsigned int usePTX32InHost64,
527 unsigned int num_verts,
529 unsigned int num_tris,
530 const unsigned* indices,
531 const unsigned* mat_indices,
533 const unsigned* norm_indices,
535 const unsigned* tex_indices );
542 #undef RTU_CHECK_ERROR
RTresult RTAPI rtGeometryGroupGetChild(RTgeometrygroup geometrygroup, unsigned int index, RTgeometryinstance *geometryinstance)
Returns a child node of a geometry group.
RTresult RTAPI rtSelectorSetChild(RTselector selector, unsigned int index, RTobject child)
Attaches a child node to a Selector node.
RTresult RTAPI rtTransformGetChildType(RTtransform transform, RTobjecttype *type)
Returns type information about a Transform child node.
RTU_INLINE RTresult rtuGroupRemoveChildByIndex(RTgroup group, unsigned int index)
Definition: optixu.h:377
RTresult
Definition: optix_declarations.h:236
RTresult RTAPI rtGroupGetChild(RTgroup group, unsigned int index, RTobject *child)
Returns a child node of a group.
RTU_INLINE RTresult rtuGeometryGroupGetChildIndex(RTgeometrygroup geometrygroup, RTgeometryinstance child, unsigned int *index)
Definition: optixu.h:436
struct RTgroup_api * RTgroup
Definition: optix_host.h:84
RTresult RTAPI rtSelectorGetChildCount(RTselector selector, unsigned int *count)
Returns the number of child node slots of a Selector node.
RTU_INLINE RTresult rtuTransformSetChild(RTtransform transform, RTobject child)
Definition: optixu.h:297
RTresult RTAPI rtTransformGetChild(RTtransform transform, RTobject *child)
Returns the child node that is attached to a Transform node.
RTresult RTAPI rtGroupGetChildCount(RTgroup group, unsigned int *count)
Returns the number of child slots for a group.
RTresult RTAPI rtuCUDACompileString(const char *source, const char **preprocessorArguments, unsigned int numPreprocessorArguments, RTsize *resultSize, RTsize *errorSize)
RTU_INLINE RTresult rtuGeometryGroupRemoveChild(RTgeometrygroup geometrygroup, RTgeometryinstance child)
Definition: optixu.h:369
RTresult RTAPI rtuCUDACompileFile(const char *filename, const char **preprocessorArguments, unsigned int numPreprocessorArguments, RTsize *resultSize, RTsize *errorSize)
RTresult RTAPI rtGeometryGroupSetChildCount(RTgeometrygroup geometrygroup, unsigned int count)
Sets the number of child nodes to be attached to the group.
RTresult RTAPI rtGeometryGroupGetChildCount(RTgeometrygroup geometrygroup, unsigned int *count)
Returns the number of child slots for a group.
RTU_INLINE RTresult rtuGroupRemoveChild(RTgroup group, RTobject child)
Definition: optixu.h:353
RTresult RTAPI rtTransformSetChild(RTtransform transform, RTobject child)
Attaches a child node to a Transform node.
RTU_INLINE RTresult rtuGroupAddChild(RTgroup group, RTobject child, unsigned int *index)
Definition: optixu.h:238
RTU_INLINE RTresult rtuSelectorGetChildIndex(RTselector selector, RTobject child, unsigned int *index)
Definition: optixu.h:423
struct RTbuffer_api * RTbuffer
Definition: optix_host.h:69
RTresult RTAPI rtGroupSetChild(RTgroup group, unsigned int index, RTobject child)
Attaches a child node to a group.
RTU_INLINE RTresult rtuSelectorRemoveChildByIndex(RTselector selector, unsigned int index)
Definition: optixu.h:388
struct RTgeometryinstance_api * RTgeometryinstance
Definition: optix_host.h:78
RTobjecttype
Definition: optix_declarations.h:104
RTformat
Definition: optix_declarations.h:63
struct RTgeometry_api * RTgeometry
Definition: optix_host.h:75
RTU_INLINE RTresult rtuSelectorAddChild(RTselector selector, RTobject child, unsigned int *index)
Definition: optixu.h:243
struct RTselector_api * RTselector
Definition: optix_host.h:93
RTresult RTAPI rtuCreateClusteredMeshExt(RTcontext context, unsigned int usePTX32InHost64, RTgeometry *mesh, unsigned int num_verts, const float *verts, unsigned int num_tris, const unsigned *indices, const unsigned *mat_indices, RTbuffer norms, const unsigned *norm_indices, RTbuffer tex_coords, const unsigned *tex_indices)
RTU_INLINE RTresult rtuTransformGetChild(RTtransform transform, RTobject *type)
Definition: optixu.h:331
RTresult RTAPI rtGeometryGroupSetChild(RTgeometrygroup geometrygroup, unsigned int index, RTgeometryinstance geometryinstance)
Attaches a child node to a geometry group.
RTresult RTAPI rtGroupSetChildCount(RTgroup group, unsigned int count)
Sets the number of child nodes to be attached to the group.
void * RTobject
Definition: optix_host.h:105
RTresult RTAPI rtuCreateClusteredMesh(RTcontext context, unsigned int usePTX32InHost64, RTgeometry *mesh, unsigned int num_verts, const float *verts, unsigned int num_tris, const unsigned *indices, const unsigned *mat_indices)
RTU_INLINE RTresult rtuGeometryGroupRemoveChildByIndex(RTgeometrygroup geometrygroup, unsigned int index)
Definition: optixu.h:399
RTresult RTAPI rtuNameForType(RTobjecttype type, char *buffer, RTsize bufferSize)
RTU_INLINE RTresult rtuGeometryGroupAddChild(RTgeometrygroup geometrygroup, RTgeometryinstance child, unsigned int *index)
Definition: optixu.h:343
RTU_INLINE RTresult rtuGroupGetChildIndex(RTgroup group, RTobject child, unsigned int *index)
Definition: optixu.h:410
RTresult RTAPI rtuGetSizeForRTformat(RTformat format, size_t *size)
Definition: optix_declarations.h:243
Definition: optix_declarations.h:238
struct RTtransform_api * RTtransform
Definition: optix_host.h:99
RTresult RTAPI rtuCUDAGetCompileResult(char *result, char *error)
struct RTcontext_api * RTcontext
Definition: optix_host.h:72
RTU_INLINE RTresult rtuTransformGetChildType(RTtransform transform, RTobjecttype *type)
Definition: optixu.h:337
RTresult RTAPI rtSelectorGetChild(RTselector selector, unsigned int index, RTobject *child)
Returns a child node that is attached to a Selector node.
RTresult RTAPI rtSelectorSetChildCount(RTselector selector, unsigned int count)
Specifies the number of child nodes to be attached to a Selector node.
struct RTgeometrygroup_api * RTgeometrygroup
Definition: optix_host.h:81
RTU_INLINE RTresult rtuSelectorRemoveChild(RTselector selector, RTobject child)
Definition: optixu.h:361