HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RV_ShaderBindFuncs Class Referenceabstract

Helper tie-in class for binding functions for UBOs and SSBOs. More...

#include <RV_ShaderBlock.h>

+ Inheritance diagram for RV_ShaderBindFuncs:

Public Member Functions

bool bindUniform (const UT_StringRef &name, RV_UniformType type, const void *data, exint data_size, int array_index=0, int array_range=1, int *opt_idx=nullptr)
 Set the value of the uniform 'name' with a block of memory. More...
 
bool bindInt (const UT_StringRef &name, int v, int array_index=0, int *opt_idx=nullptr)
 
bool bindFloat (const UT_StringRef &name, fpreal32 v, int array_index=0, int *opt_idx=nullptr)
 Bind a single float value. More...
 
bool bindDouble (const UT_StringRef &name, fpreal64 v, int array_index=0, int *opt_idx=nullptr)
 Bind a single double value. GPU must support native FP64 values. More...
 
bool bindUint64 (const UT_StringRef &name, uint64 v, int array_index=0, int *opt_idx=nullptr)
 
bool bindInts (const UT_StringRef &name, const int *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 Set values for a fixed-length integer array. More...
 
bool bindFloats (const UT_StringRef &name, const fpreal32 *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 Set values for a fixed-length float array. More...
 
bool bindDoubles (const UT_StringRef &name, const fpreal64 *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 Set values for a fixed-length double array. More...
 
bool bindUint64s (const UT_StringRef &name, const uint64 *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 Set values for a uint64 handle array. More...
 
bool bindIntVector3 (const UT_StringRef &name, const int *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 bind a series of ivec3s, using std140 packing (padded to ivec4) More...
 
bool bindVector3 (const UT_StringRef &name, const fpreal32 *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 bind a series of vec3s, using std140 packing (padded to ivec4) More...
 
bool bindDVector3 (const UT_StringRef &name, const fpreal64 *valarray, int array_size, int array_index=0, int *opt_idx=nullptr)
 bind a series of dvec3s, using std140 packing (padded to ivec4) More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector2F &v, int array_index=0, int *opt_idx=nullptr)
 Bind a single vec2 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector3F &v, int array_index=0, int *opt_idx=nullptr)
 Bind a single vec3 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector4F &v, int array_index=0, int *opt_idx=nullptr)
 Bind a single vec4 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector2D &v, int array_index=0, int *opt_idx=nullptr)
 Bind a single dvec2 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector3D &v, int array_index=0, int *opt_idx=nullptr)
 Set a single dvec3 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector4D &v, int array_index=0, int *opt_idx=nullptr)
 Set a single dvec4 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector2i &v, int array_index=0, int *opt_idx=nullptr)
 Bind a single ivec2 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector3i &v, int array_index=0, int *opt_idx=nullptr)
 Set a single ivec3 uniform value. More...
 
bool bindVector (const UT_StringRef &name, const UT_Vector4i &v, int array_index=0, int *opt_idx=nullptr)
 Set a single ivec4 uniform value. More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix2F &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 2x2 matrix value. More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix3F &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 3x3 matrix value. More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix4F &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 4x4 matrix value. More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix2D &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 2x2 matrix value (dmat2). More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix3D &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 3x3 matrix value (dmat3). More...
 
bool bindMatrix (const UT_StringRef &name, const UT_Matrix4D &m, int array_index=0, int *opt_idx=nullptr)
 Set a single 4x4 matrix value (dmat4). More...
 

Protected Member Functions

virtual const RV_UniformgetUniform (const UT_StringRef &name, int *opt_idx)=0
 
virtual void copyToBuffer (const void *data, int size, int offset, const char *name)=0
 Copy array of data into the CPU buffer. More...
 
virtual void copyToBufferStride (const void *data, int len, int size, int stride, int offset, const char *name)=0
 
 RV_ShaderBindFuncs ()
 
virtual ~RV_ShaderBindFuncs ()
 

Detailed Description

Helper tie-in class for binding functions for UBOs and SSBOs.

Definition at line 94 of file RV_ShaderBlock.h.

Constructor & Destructor Documentation

RV_ShaderBindFuncs::RV_ShaderBindFuncs ( )
inlineprotected

Definition at line 292 of file RV_ShaderBlock.h.

virtual RV_ShaderBindFuncs::~RV_ShaderBindFuncs ( )
inlineprotectedvirtual

Definition at line 295 of file RV_ShaderBlock.h.

Member Function Documentation

bool RV_ShaderBindFuncs::bindDouble ( const UT_StringRef name,
fpreal64  v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single double value. GPU must support native FP64 values.

bool RV_ShaderBindFuncs::bindDoubles ( const UT_StringRef name,
const fpreal64 valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

Set values for a fixed-length double array.

bool RV_ShaderBindFuncs::bindDVector3 ( const UT_StringRef name,
const fpreal64 valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

bind a series of dvec3s, using std140 packing (padded to ivec4)

bool RV_ShaderBindFuncs::bindFloat ( const UT_StringRef name,
fpreal32  v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single float value.

bool RV_ShaderBindFuncs::bindFloats ( const UT_StringRef name,
const fpreal32 valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

Set values for a fixed-length float array.

bool RV_ShaderBindFuncs::bindInt ( const UT_StringRef name,
int  v,
int  array_index = 0,
int opt_idx = nullptr 
)

Copy the data for uniform 'name' into the buffer. If name does not exist in the buffer, or its type/array size doesn't match, bind...() will return false. If its value is not different from the current value in the block, it will not cause an upload. Shader Storage Blocks can have open-ended arrays, and variables within those arrays can specify their array index with 'array_index'.

bool RV_ShaderBindFuncs::bindInts ( const UT_StringRef name,
const int valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

Set values for a fixed-length integer array.

bool RV_ShaderBindFuncs::bindIntVector3 ( const UT_StringRef name,
const int valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

bind a series of ivec3s, using std140 packing (padded to ivec4)

vec3 is a little different, as it is padded to vec4 in uniform blocks. SSBOs with std420 packing should use bindVector().

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix2F m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 2x2 matrix value.

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix3F m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 3x3 matrix value.

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix4F m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 4x4 matrix value.

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix2D m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 2x2 matrix value (dmat2).

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix3D m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 3x3 matrix value (dmat3).

bool RV_ShaderBindFuncs::bindMatrix ( const UT_StringRef name,
const UT_Matrix4D m,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single 4x4 matrix value (dmat4).

bool RV_ShaderBindFuncs::bindUint64 ( const UT_StringRef name,
uint64  v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single handle value to a sampler. GPU must support bindless textures.

bool RV_ShaderBindFuncs::bindUint64s ( const UT_StringRef name,
const uint64 valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

Set values for a uint64 handle array.

bool RV_ShaderBindFuncs::bindUniform ( const UT_StringRef name,
RV_UniformType  type,
const void data,
exint  data_size,
int  array_index = 0,
int  array_range = 1,
int opt_idx = nullptr 
)

Set the value of the uniform 'name' with a block of memory.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector2F v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single vec2 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector3F v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single vec3 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector4F v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single vec4 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector2D v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single dvec2 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector3D v,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single dvec3 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector4D v,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single dvec4 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector2i v,
int  array_index = 0,
int opt_idx = nullptr 
)

Bind a single ivec2 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector3i v,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single ivec3 uniform value.

bool RV_ShaderBindFuncs::bindVector ( const UT_StringRef name,
const UT_Vector4i v,
int  array_index = 0,
int opt_idx = nullptr 
)

Set a single ivec4 uniform value.

bool RV_ShaderBindFuncs::bindVector3 ( const UT_StringRef name,
const fpreal32 valarray,
int  array_size,
int  array_index = 0,
int opt_idx = nullptr 
)

bind a series of vec3s, using std140 packing (padded to ivec4)

virtual void RV_ShaderBindFuncs::copyToBuffer ( const void data,
int  size,
int  offset,
const char *  name 
)
protectedpure virtual

Copy array of data into the CPU buffer.

virtual void RV_ShaderBindFuncs::copyToBufferStride ( const void data,
int  len,
int  size,
int  stride,
int  offset,
const char *  name 
)
protectedpure virtual

Copy data into the CPU buffer with a specified stride. incoming data is tightly packed, with padding added in the buffer to match stride

virtual const RV_Uniform* RV_ShaderBindFuncs::getUniform ( const UT_StringRef name,
int opt_idx 
)
protectedpure virtual

The documentation for this class was generated from the following file: