OptiX  3.9
NVIDIA OptiX Acceleration Engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Classes | Macros | Functions
optixpp_namespace.h File Reference

Detailed Description

A C++ wrapper around the OptiX API.

Go to the source code of this file.

Classes

class  optix::Handle< T >
 
class  optix::Exception
 
class  optix::APIObj
 
class  optix::DestroyableObj
 
class  optix::ScopedObj
 
class  optix::VariableObj
 
class  optix::ContextObj
 
class  optix::ProgramObj
 
class  optix::GroupObj
 
class  optix::GeometryGroupObj
 
class  optix::TransformObj
 
class  optix::SelectorObj
 
class  optix::AccelerationObj
 
class  optix::GeometryInstanceObj
 
class  optix::GeometryObj
 
class  optix::MaterialObj
 
class  optix::TextureSamplerObj
 
class  optix::BufferObj
 
struct  optix::bufferId< T, Dim >
 
class  optix::callableProgramId< T >
 
class  optix::RemoteDeviceObj
 

Macros

#define WIN32_LEAN_AND_MEAN
 
#define rtBufferId   optix::bufferId
 
#define RT_INTERNAL_CALLABLE_PROGRAM_DEFS()
 
#define rtCallableProgramId   optix::callableProgramId
 

Typedefs

typedef Handle< AccelerationObj > optix::Acceleration
 
typedef Handle< BufferObj > optix::Buffer
 
typedef Handle< ContextObj > optix::Context
 
typedef Handle< GeometryObj > optix::Geometry
 
typedef Handle< GeometryGroupObj > optix::GeometryGroup
 
typedef Handle
< GeometryInstanceObj > 
optix::GeometryInstance
 
typedef Handle< GroupObj > optix::Group
 
typedef Handle< MaterialObj > optix::Material
 
typedef Handle< ProgramObj > optix::Program
 
typedef Handle< RemoteDeviceObj > optix::RemoteDevice
 
typedef Handle< SelectorObj > optix::Selector
 
typedef Handle< TextureSamplerObj > optix::TextureSampler
 
typedef Handle< TransformObj > optix::Transform
 
typedef Handle< VariableObj > optix::Variable
 

Functions

template<typename ReturnT >
class callableProgramId< ReturnT()> optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T >
class callableProgramId
< ReturnT(Arg0T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T >
class callableProgramId
< ReturnT(Arg0T, Arg1T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T , typename Arg5T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T, Arg5T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T , typename Arg5T , typename Arg6T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T, Arg5T, Arg6T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T , typename Arg5T , typename Arg6T , typename Arg7T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T, Arg5T, Arg6T,
Arg7T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T , typename Arg5T , typename Arg6T , typename Arg7T , typename Arg8T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T, Arg5T, Arg6T,
Arg7T, Arg8T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 
template<typename ReturnT , typename Arg0T , typename Arg1T , typename Arg2T , typename Arg3T , typename Arg4T , typename Arg5T , typename Arg6T , typename Arg7T , typename Arg8T , typename Arg9T >
class callableProgramId
< ReturnT(Arg0T, Arg1T, Arg2T,
Arg3T, Arg4T, Arg5T, Arg6T,
Arg7T, Arg8T, Arg9T)> 
optix::RT_INTERNAL_CALLABLE_PROGRAM_DEFS ()
 

Macro Definition Documentation

#define RT_INTERNAL_CALLABLE_PROGRAM_DEFS ( )
Value:
{ \
public: \
callableProgramId() {} \
callableProgramId(int id) : m_id(id) {} \
int getId() const { return m_id; } \
private: \
int m_id; \
}

callableProgramId is a host version of the device side callableProgramId.

Use callableProgramId to define types that can be included from both the host and device code. This class provides a container that can be used to transport the program id back and forth between host and device code. The callableProgramId class is useful, because it can take a program id obtained from rtProgramGetId and provide accessors for calling the program corresponding to the program id.

"bindless_type.h" used by both host and device code:

#include <optix_world.h>
struct ProgramInfo {
int val;
rtProgramId<int(int)> program;
};

Host code:

#include "bindless_type.h"
ProgramInfo input_program_info;
input_program_info.val = 0;
input_program_info.program = rtCallableProgramId<int(int)>(inputProgram0->getId());
context["input_program_info"]->setUserData(sizeof(ProgramInfo), &input_program_info);

Device code:

#include "bindless_type.h"
rtBuffer<int,1> result;
rtDeclareVariable(ProgramInfo, input_program_info, ,);
RT_PROGRAM void bindless()
{
int value = input_program_info.program(input_program_info.val);
result[0] = value;
}