HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RE_VertexArray Class Reference

#include <RE_VertexArray.h>

Classes

class  re_VertexArrayCB
 

Public Member Functions

 ~RE_VertexArray ()
 
RE_VertexArrayclone () const
 
int64 getMemoryUsage (bool inclusive) const
 
void cacheBuffer (const char *name)
 
const char * getCacheName () const
 
void setCacheVersion (RE_CacheVersion v)
 
RE_CacheVersion getCacheVersion () const
 
void markAsUsed ()
 
void markAsUnused (bool move_to_unused_cache=true)
 
bool isUsed () const
 
void setCacheTag (RE_CacheTagHandle h)
 
void setUsage (RE_BufferUsageHint h)
 
void setPersistent (RE_PersistentBufferMode mode)
 
void adoptArrays (const UT_Array< RE_OGLBufferHandle > &buffers, const char *cachename)
 
void resetBuffer (bool delete_cached=false, bool mark_as_unused=true)
 
bool initialize (RE_Render *r, bool *created=NULL)
 
bool setExtraBufferData (RE_CachedExtraData *data)
 
RE_CachedExtraDataHandle getExtraBufferData () const
 
void setBufferType (RE_BufferType type)
 
void setAttributeName (const char *attrib)
 
void setFormat (RE_GPUType type, int vectorsize, bool normalized=true)
 
void setLength (int len)
 
void setInstanceStride (int nprims)
 
void setInstanceGroup (int instance_group)
 
void setArrayType (RE_ArrayType t)
 
bool setArray (RE_Render *r, const void *data, int offset=0, int sublen=0, int array_index=0)
 
bool replaceArray (RE_Render *r, const void *data, int array_index=0)
 
bool replaceArrayRange (RE_Render *r, const void *data, int offset, int length, int array_index)
 
bool getArray (RE_Render *r, void *data, int offset=0, int sublen=0, int array_index=0) const
 
void orphan (RE_Render *r)
 
void setConstant (const fpreal32 *data)
 
void setConstant (const fpreal64 *data)
 
void createConstant ()
 
fpreal64getConstant ()
 
void markAsDefaultValue (bool def)
 
bool isDefaultValue () const
 
voidmap (RE_Render *r, RE_BufferAccess access=RE_BUFFER_WRITE_ONLY, int array_index=0)
 
voidmapRange (RE_Render *r, int start, int length, RE_BufferAccess access=RE_BUFFER_WRITE_ONLY, int array_index=0)
 
void unmap (RE_Render *r, int array_index=0)
 
voidgetPersistentMap (int array_index=0) const
 
bool isPersistentMap () const
 
void zero (RE_Render *r)
 
bool attachTexBuffer (RE_Render *r, RE_Texture *tex)
 
RE_TexturegetTextureBufferObject () const
 
bool bind (RE_Render *r, unsigned int stride=0, bool geo_obj=false, const char *shader_attrib=NULL)
 
bool unbind (RE_Render *r)
 
bool rebindAttrib (RE_Render *r, int location)
 
bool unbindAttrib (RE_Render *r)
 
bool setupForAttribIndex (RE_Render *r, int attrib_location, RE_GPUType t, int stride)
 
bool bindBuffer (RE_Render *r, RE_BufferBinding point, int index=0, int array_index=0)
 
bool unbindBuffer (RE_Render *r, RE_BufferBinding point, int index=0, int array_index=0)
 
void drawPrims (RE_Render *r, RE_PrimType prim, unsigned int stride, int num_instances, bool enable_arrays, int vertices_per_patch)
 
void drawSomePrims (RE_Render *r, RE_PrimType prim, int start, int num, int num_instances, bool enable_arrays, int vertices_per_patch)
 
void drawSomePrims (RE_Render *r, RE_PrimType prim, RE_VertexArray *index_array, int index_offset, int index_num_elements, int num_instances, bool enable_arrays, int vertices_per_patch)
 
RE_BufferType getBufferType () const
 
RE_GPUType getDataType () const
 
int getVectorSize () const
 
int getLength () const
 
int getNumBuffers () const
 
const RE_OGLBufferHandlegetArrayBuffer (int i=0) const
 
const char * getAttributeName () const
 
RE_ArrayType getArrayType () const
 
bool isBufferBound (int array_index=0) const
 
bool isConstantBuffer () const
 
void getHoudiniName (UT_String &name) const
 
void getGLName (UT_String &name) const
 
int getInstanceStride () const
 
int getInstanceGroup () const
 
int64 getSizeBytes () const
 
void print (std::ostream *os=nullptr) const
 
void printValues (RE_Render *r, std::ostream &os, int start=0, int len=0) const
 
void addRef (void(*callback)(void *), void *data)
 
void removeRef (void(*callback)(void *), void *data)
 
void setGenericID (RE_GenericAttribID id)
 
RE_GenericAttribID getGenericID () const
 

Static Public Member Functions

static RE_VertexArraynewAttribArray (const char *name, int num_elements=0, const char *cachename=NULL, RE_ArrayType at=RE_ARRAY_POINT)
 
static RE_VertexArraynewElementArray (int num_elements=0, const char *cachename=NULL)
 
static RE_VertexArraynewArrayContainer (RE_OGLBufferHandle &array, const char *cachename=NULL, RE_ArrayType at=RE_ARRAY_POINT)
 
static RE_VertexArraynewArrayContainer (UT_Array< RE_OGLBufferHandle > &array, const char *cachename=NULL, RE_ArrayType at=RE_ARRAY_POINT)
 
static void getAttribCacheName (UT_WorkBuffer &str, const char *name, RE_ArrayType attrib_type, const char *cachename)
 

Protected Member Functions

 RE_VertexArray (RE_BufferType type, int nelements=0)
 
 RE_VertexArray (const char *name, int nelements=0)
 
 RE_VertexArray (const RE_VertexArray &va)
 
void detachTexBuffer (int index)
 
void generateCacheName (UT_String &cachename, int index) const
 

Protected Attributes

UT_String myCacheName
 
UT_String myAttribName
 
RE_BufferType myBufferType
 
RE_GPUType myType
 
int myVectorSize
 
int myLength
 
int myLengthScale
 
int myInstanceStride
 
UT_Array< RE_OGLBufferHandlemyArray
 
RE_OGLConstAttribute * myConstAttrib
 
RE_CacheTagHandle myCacheTagHandle
 
RE_BufferUsageHint myUsage
 
bool myInUse
 
bool myMappedFlag [4]
 
bool myConstantFlag
 
bool myNormalizedFlag
 
RE_ArrayType myArrayType
 
RE_GenericAttribID myGenID
 
int myInstanceGroup
 
RE_PersistentBufferMode myPersistentBufferMode
 
bool myPersistentMapCopied
 
bool myDefaultValue
 
UT_Array< re_VertexArrayCBmyRefs
 

Static Protected Attributes

static RE_OGLBufferHandle theNullArray
 

Detailed Description

Constructor & Destructor Documentation

RE_VertexArray::~RE_VertexArray ( )
RE_VertexArray::RE_VertexArray ( RE_BufferType  type,
int  nelements = 0 
)
protected
RE_VertexArray::RE_VertexArray ( const char *  name,
int  nelements = 0 
)
protected
RE_VertexArray::RE_VertexArray ( const RE_VertexArray va)
protected

Member Function Documentation

void RE_VertexArray::addRef ( void(*)(void *)  callback,
void data 
)
void RE_VertexArray::adoptArrays ( const UT_Array< RE_OGLBufferHandle > &  buffers,
const char *  cachename 
)
bool RE_VertexArray::attachTexBuffer ( RE_Render r,
RE_Texture tex 
)
bool RE_VertexArray::bind ( RE_Render r,
unsigned int  stride = 0,
bool  geo_obj = false,
const char *  shader_attrib = NULL 
)
bool RE_VertexArray::bindBuffer ( RE_Render r,
RE_BufferBinding  point,
int  index = 0,
int  array_index = 0 
)
void RE_VertexArray::cacheBuffer ( const char *  name)
RE_VertexArray* RE_VertexArray::clone ( ) const
void RE_VertexArray::createConstant ( )
void RE_VertexArray::detachTexBuffer ( int  index)
protected
void RE_VertexArray::drawPrims ( RE_Render r,
RE_PrimType  prim,
unsigned int  stride,
int  num_instances,
bool  enable_arrays,
int  vertices_per_patch 
)
void RE_VertexArray::drawSomePrims ( RE_Render r,
RE_PrimType  prim,
int  start,
int  num,
int  num_instances,
bool  enable_arrays,
int  vertices_per_patch 
)
void RE_VertexArray::drawSomePrims ( RE_Render r,
RE_PrimType  prim,
RE_VertexArray index_array,
int  index_offset,
int  index_num_elements,
int  num_instances,
bool  enable_arrays,
int  vertices_per_patch 
)
void RE_VertexArray::generateCacheName ( UT_String cachename,
int  index 
) const
protected
bool RE_VertexArray::getArray ( RE_Render r,
void data,
int  offset = 0,
int  sublen = 0,
int  array_index = 0 
) const
const RE_OGLBufferHandle& RE_VertexArray::getArrayBuffer ( int  i = 0) const
inline

Definition at line 289 of file RE_VertexArray.h.

RE_ArrayType RE_VertexArray::getArrayType ( ) const
inline

Definition at line 292 of file RE_VertexArray.h.

static void RE_VertexArray::getAttribCacheName ( UT_WorkBuffer str,
const char *  name,
RE_ArrayType  attrib_type,
const char *  cachename 
)
static
const char* RE_VertexArray::getAttributeName ( ) const
inline

Definition at line 291 of file RE_VertexArray.h.

RE_BufferType RE_VertexArray::getBufferType ( ) const
inline

Definition at line 284 of file RE_VertexArray.h.

const char* RE_VertexArray::getCacheName ( ) const
inline

Definition at line 67 of file RE_VertexArray.h.

RE_CacheVersion RE_VertexArray::getCacheVersion ( ) const
fpreal64* RE_VertexArray::getConstant ( )
RE_GPUType RE_VertexArray::getDataType ( ) const
inline

Definition at line 285 of file RE_VertexArray.h.

RE_CachedExtraDataHandle RE_VertexArray::getExtraBufferData ( ) const
RE_GenericAttribID RE_VertexArray::getGenericID ( ) const
inline

Definition at line 316 of file RE_VertexArray.h.

void RE_VertexArray::getGLName ( UT_String name) const
void RE_VertexArray::getHoudiniName ( UT_String name) const
int RE_VertexArray::getInstanceGroup ( ) const
inline

Definition at line 298 of file RE_VertexArray.h.

int RE_VertexArray::getInstanceStride ( ) const
inline

Definition at line 297 of file RE_VertexArray.h.

int RE_VertexArray::getLength ( void  ) const
inline

Definition at line 287 of file RE_VertexArray.h.

int64 RE_VertexArray::getMemoryUsage ( bool  inclusive) const

Returns the amount of main memory (NOT graphics memory!) owned by this RE_VertexArray.

int RE_VertexArray::getNumBuffers ( ) const
inline

Definition at line 288 of file RE_VertexArray.h.

void* RE_VertexArray::getPersistentMap ( int  array_index = 0) const
int64 RE_VertexArray::getSizeBytes ( ) const
RE_Texture * RE_VertexArray::getTextureBufferObject ( ) const
inline

Definition at line 364 of file RE_VertexArray.h.

int RE_VertexArray::getVectorSize ( ) const
inline

Definition at line 286 of file RE_VertexArray.h.

bool RE_VertexArray::initialize ( RE_Render r,
bool *  created = NULL 
)
bool RE_VertexArray::isBufferBound ( int  array_index = 0) const
bool RE_VertexArray::isConstantBuffer ( ) const
inline

Definition at line 294 of file RE_VertexArray.h.

bool RE_VertexArray::isDefaultValue ( ) const
inline

Definition at line 189 of file RE_VertexArray.h.

bool RE_VertexArray::isPersistentMap ( ) const
bool RE_VertexArray::isUsed ( ) const
inline

Definition at line 76 of file RE_VertexArray.h.

void* RE_VertexArray::map ( RE_Render r,
RE_BufferAccess  access = RE_BUFFER_WRITE_ONLY,
int  array_index = 0 
)
void* RE_VertexArray::mapRange ( RE_Render r,
int  start,
int  length,
RE_BufferAccess  access = RE_BUFFER_WRITE_ONLY,
int  array_index = 0 
)
void RE_VertexArray::markAsDefaultValue ( bool  def)
inline

Definition at line 188 of file RE_VertexArray.h.

void RE_VertexArray::markAsUnused ( bool  move_to_unused_cache = true)
void RE_VertexArray::markAsUsed ( )
static RE_VertexArray* RE_VertexArray::newArrayContainer ( RE_OGLBufferHandle array,
const char *  cachename = NULL,
RE_ArrayType  at = RE_ARRAY_POINT 
)
static
static RE_VertexArray* RE_VertexArray::newArrayContainer ( UT_Array< RE_OGLBufferHandle > &  array,
const char *  cachename = NULL,
RE_ArrayType  at = RE_ARRAY_POINT 
)
static
static RE_VertexArray* RE_VertexArray::newAttribArray ( const char *  name,
int  num_elements = 0,
const char *  cachename = NULL,
RE_ArrayType  at = RE_ARRAY_POINT 
)
static
static RE_VertexArray* RE_VertexArray::newElementArray ( int  num_elements = 0,
const char *  cachename = NULL 
)
static
void RE_VertexArray::orphan ( RE_Render r)
void RE_VertexArray::print ( std::ostream *  os = nullptr) const
void RE_VertexArray::printValues ( RE_Render r,
std::ostream &  os,
int  start = 0,
int  len = 0 
) const
bool RE_VertexArray::rebindAttrib ( RE_Render r,
int  location 
)
void RE_VertexArray::removeRef ( void(*)(void *)  callback,
void data 
)
bool RE_VertexArray::replaceArray ( RE_Render r,
const void data,
int  array_index = 0 
)
inline

Definition at line 149 of file RE_VertexArray.h.

bool RE_VertexArray::replaceArrayRange ( RE_Render r,
const void data,
int  offset,
int  length,
int  array_index 
)
inline

Definition at line 154 of file RE_VertexArray.h.

void RE_VertexArray::resetBuffer ( bool  delete_cached = false,
bool  mark_as_unused = true 
)
bool RE_VertexArray::setArray ( RE_Render r,
const void data,
int  offset = 0,
int  sublen = 0,
int  array_index = 0 
)
void RE_VertexArray::setArrayType ( RE_ArrayType  t)
inline

Definition at line 137 of file RE_VertexArray.h.

void RE_VertexArray::setAttributeName ( const char *  attrib)
void RE_VertexArray::setBufferType ( RE_BufferType  type)
void RE_VertexArray::setCacheTag ( RE_CacheTagHandle  h)
void RE_VertexArray::setCacheVersion ( RE_CacheVersion  v)
void RE_VertexArray::setConstant ( const fpreal32 data)
void RE_VertexArray::setConstant ( const fpreal64 data)
bool RE_VertexArray::setExtraBufferData ( RE_CachedExtraData data)
void RE_VertexArray::setFormat ( RE_GPUType  type,
int  vectorsize,
bool  normalized = true 
)
void RE_VertexArray::setGenericID ( RE_GenericAttribID  id)
inline

Definition at line 313 of file RE_VertexArray.h.

void RE_VertexArray::setInstanceGroup ( int  instance_group)
inline

Definition at line 132 of file RE_VertexArray.h.

void RE_VertexArray::setInstanceStride ( int  nprims)
void RE_VertexArray::setLength ( int  len)
void RE_VertexArray::setPersistent ( RE_PersistentBufferMode  mode)

Set the buffer to use persistent mapped buffers, optionally with coherent behaviour (writes seen automatically). RE_EXT_BUFFER_STORAGE must be supported, or false will be returned and the setting will have no effect.

bool RE_VertexArray::setupForAttribIndex ( RE_Render r,
int  attrib_location,
RE_GPUType  t,
int  stride 
)
void RE_VertexArray::setUsage ( RE_BufferUsageHint  h)

Hint to the GL driver how this buffer will be used. May only be set before the buffer is created (initialize(), setArray(), etc).

bool RE_VertexArray::unbind ( RE_Render r)
bool RE_VertexArray::unbindAttrib ( RE_Render r)
bool RE_VertexArray::unbindBuffer ( RE_Render r,
RE_BufferBinding  point,
int  index = 0,
int  array_index = 0 
)
void RE_VertexArray::unmap ( RE_Render r,
int  array_index = 0 
)
void RE_VertexArray::zero ( RE_Render r)

Member Data Documentation

UT_Array<RE_OGLBufferHandle> RE_VertexArray::myArray
protected

Definition at line 335 of file RE_VertexArray.h.

RE_ArrayType RE_VertexArray::myArrayType
protected

Definition at line 345 of file RE_VertexArray.h.

UT_String RE_VertexArray::myAttribName
protected

Definition at line 328 of file RE_VertexArray.h.

RE_BufferType RE_VertexArray::myBufferType
protected

Definition at line 329 of file RE_VertexArray.h.

UT_String RE_VertexArray::myCacheName
protected

Definition at line 327 of file RE_VertexArray.h.

RE_CacheTagHandle RE_VertexArray::myCacheTagHandle
protected

Definition at line 338 of file RE_VertexArray.h.

bool RE_VertexArray::myConstantFlag
protected

Definition at line 343 of file RE_VertexArray.h.

RE_OGLConstAttribute* RE_VertexArray::myConstAttrib
protected

Definition at line 337 of file RE_VertexArray.h.

bool RE_VertexArray::myDefaultValue
protected

Definition at line 350 of file RE_VertexArray.h.

RE_GenericAttribID RE_VertexArray::myGenID
protected

Definition at line 346 of file RE_VertexArray.h.

int RE_VertexArray::myInstanceGroup
protected

Definition at line 347 of file RE_VertexArray.h.

int RE_VertexArray::myInstanceStride
protected

Definition at line 334 of file RE_VertexArray.h.

bool RE_VertexArray::myInUse
protected

Definition at line 340 of file RE_VertexArray.h.

int RE_VertexArray::myLength
protected

Definition at line 332 of file RE_VertexArray.h.

int RE_VertexArray::myLengthScale
protected

Definition at line 333 of file RE_VertexArray.h.

bool RE_VertexArray::myMappedFlag[4]
protected

Definition at line 342 of file RE_VertexArray.h.

bool RE_VertexArray::myNormalizedFlag
protected

Definition at line 344 of file RE_VertexArray.h.

RE_PersistentBufferMode RE_VertexArray::myPersistentBufferMode
protected

Definition at line 348 of file RE_VertexArray.h.

bool RE_VertexArray::myPersistentMapCopied
protected

Definition at line 349 of file RE_VertexArray.h.

UT_Array<re_VertexArrayCB> RE_VertexArray::myRefs
protected

Definition at line 360 of file RE_VertexArray.h.

RE_GPUType RE_VertexArray::myType
protected

Definition at line 330 of file RE_VertexArray.h.

RE_BufferUsageHint RE_VertexArray::myUsage
protected

Definition at line 339 of file RE_VertexArray.h.

int RE_VertexArray::myVectorSize
protected

Definition at line 331 of file RE_VertexArray.h.

RE_OGLBufferHandle RE_VertexArray::theNullArray
staticprotected

Definition at line 336 of file RE_VertexArray.h.


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