OWL
OptiX7 Wrapper Library
owl::Variable Struct Referenceabstract

#include <Variable.h>

Inheritance diagram for owl::Variable:
owl::Object owl::BufferPointerVariable owl::BufferVariable owl::DeviceIndexVariable owl::GroupVariable owl::TextureVariable owl::UserTypeVariable owl::VariableT< T >

Public Types

typedef std::shared_ptr< VariableSP
 
- Public Types inherited from owl::Object
typedef std::shared_ptr< ObjectSP
 

Public Member Functions

 Variable (const OWLVarDecl *const varDecl)
 
virtual void set (const std::shared_ptr< Buffer > &value)
 
virtual void set (const std::shared_ptr< Group > &value)
 
virtual void set (const std::shared_ptr< Texture > &value)
 
virtual void setRaw (const void *ptr)
 
virtual void set (const int32_t &value)
 
virtual void set (const vec2i &value)
 
virtual void set (const vec3i &value)
 
virtual void set (const vec4i &value)
 
virtual void set (const uint32_t &value)
 
virtual void set (const vec2ui &value)
 
virtual void set (const vec3ui &value)
 
virtual void set (const vec4ui &value)
 
virtual void set (const int64_t &value)
 
virtual void set (const vec2l &value)
 
virtual void set (const vec3l &value)
 
virtual void set (const vec4l &value)
 
virtual void set (const uint64_t &value)
 
virtual void set (const vec2ul &value)
 
virtual void set (const vec3ul &value)
 
virtual void set (const vec4ul &value)
 
virtual void set (const float &value)
 
virtual void set (const vec2f &value)
 
virtual void set (const vec3f &value)
 
virtual void set (const vec4f &value)
 
virtual void set (const double &value)
 
virtual void set (const vec2d &value)
 
virtual void set (const vec3d &value)
 
virtual void set (const vec4d &value)
 
virtual std::string toString () const
 
void mismatchingType ()
 
virtual void writeToSBT (uint8_t *sbtEntry, const DeviceContext::SP &device) const =0
 
- Public Member Functions inherited from owl::Object
 Object ()
 
virtual DeviceData::SP createOn (const std::shared_ptr< DeviceContext > &device)
 
void createDeviceData (const std::vector< std::shared_ptr< DeviceContext >> &devices)
 
template<typename T >
std::shared_ptr< T > as ()
 

Static Public Member Functions

static Variable::SP createInstanceOf (const OWLVarDecl *decl)
 

Public Attributes

const OWLVarDecl *const varDecl
 
- Public Attributes inherited from owl::Object
const size_t uniqueID
 
std::vector< DeviceData::SPdeviceData
 

Additional Inherited Members

- Static Public Attributes inherited from owl::Object
static std::atomic< uint64_t > nextAvailableID
 

Detailed Description

"Variable"s are associated with objects, and hold user-supplied data of a given type. The purpose of this is to allow owl to internally populate device-side Shader Binding Table (SBT) entries based on host-side supplied parameters - ie, if sets a Group, Buffer, etc, parameter on the host, then we will automatically translate that to the respecitve device data (in these examples a OptiXTraversablaHandle, or device pointer) when we write it into the SBT.

To add some type-safety into OWL we create, for each paramter that the user declares for an object, a matching (templated) variable type; if the user then tries to set a variable of a different type than declared we'll throw a 'mismatchingType' expception

Member Typedef Documentation

◆ SP

typedef std::shared_ptr<Variable> owl::Variable::SP

Constructor & Destructor Documentation

◆ Variable()

owl::Variable::Variable ( const OWLVarDecl *const  varDecl)
inline

Member Function Documentation

◆ createInstanceOf()

Variable::SP owl::Variable::createInstanceOf ( const OWLVarDecl decl)
static

creates an instance of this variable type to be attached to a given object - this instance will can then store the values that the user passes

creates a variable type that matches the given variable declaration

◆ mismatchingType()

void owl::Variable::mismatchingType ( )

throw an exception that the type the user tried to set doesn't math the type he/she declared

◆ set() [1/27]

virtual void owl::Variable::set ( const double &  value)
inlinevirtual

◆ set() [2/27]

virtual void owl::Variable::set ( const float &  value)
inlinevirtual

◆ set() [3/27]

virtual void owl::Variable::set ( const int32_t &  value)
inlinevirtual

◆ set() [4/27]

virtual void owl::Variable::set ( const int64_t &  value)
inlinevirtual

◆ set() [5/27]

virtual void owl::Variable::set ( const std::shared_ptr< Buffer > &  value)
inlinevirtual

◆ set() [6/27]

virtual void owl::Variable::set ( const std::shared_ptr< Group > &  value)
inlinevirtual

◆ set() [7/27]

virtual void owl::Variable::set ( const std::shared_ptr< Texture > &  value)
inlinevirtual

◆ set() [8/27]

virtual void owl::Variable::set ( const uint32_t &  value)
inlinevirtual

◆ set() [9/27]

virtual void owl::Variable::set ( const uint64_t &  value)
inlinevirtual

◆ set() [10/27]

virtual void owl::Variable::set ( const vec2d &  value)
inlinevirtual

◆ set() [11/27]

virtual void owl::Variable::set ( const vec2f &  value)
inlinevirtual

◆ set() [12/27]

virtual void owl::Variable::set ( const vec2i &  value)
inlinevirtual

◆ set() [13/27]

virtual void owl::Variable::set ( const vec2l &  value)
inlinevirtual

◆ set() [14/27]

virtual void owl::Variable::set ( const vec2ui &  value)
inlinevirtual

◆ set() [15/27]

virtual void owl::Variable::set ( const vec2ul &  value)
inlinevirtual

◆ set() [16/27]

virtual void owl::Variable::set ( const vec3d &  value)
inlinevirtual

◆ set() [17/27]

virtual void owl::Variable::set ( const vec3f &  value)
inlinevirtual

◆ set() [18/27]

virtual void owl::Variable::set ( const vec3i &  value)
inlinevirtual

◆ set() [19/27]

virtual void owl::Variable::set ( const vec3l &  value)
inlinevirtual

◆ set() [20/27]

virtual void owl::Variable::set ( const vec3ui &  value)
inlinevirtual

◆ set() [21/27]

virtual void owl::Variable::set ( const vec3ul &  value)
inlinevirtual

◆ set() [22/27]

virtual void owl::Variable::set ( const vec4d &  value)
inlinevirtual

◆ set() [23/27]

virtual void owl::Variable::set ( const vec4f &  value)
inlinevirtual

◆ set() [24/27]

virtual void owl::Variable::set ( const vec4i &  value)
inlinevirtual

◆ set() [25/27]

virtual void owl::Variable::set ( const vec4l &  value)
inlinevirtual

◆ set() [26/27]

virtual void owl::Variable::set ( const vec4ui &  value)
inlinevirtual

◆ set() [27/27]

virtual void owl::Variable::set ( const vec4ul &  value)
inlinevirtual

◆ setRaw()

virtual void owl::Variable::setRaw ( const void *  ptr)
inlinevirtual

Reimplemented in owl::UserTypeVariable.

◆ toString()

virtual std::string owl::Variable::toString ( ) const
inlinevirtual

pretty-printer, for printf-debugging

Reimplemented from owl::Object.

◆ writeToSBT()

virtual void owl::Variable::writeToSBT ( uint8_t *  sbtEntry,
const DeviceContext::SP device 
) const
pure virtual

Member Data Documentation

◆ varDecl

const OWLVarDecl* const owl::Variable::varDecl

the variable we're setting in the given object


The documentation for this struct was generated from the following files: