HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 UT_StringHolder &name)
 
const char * getCacheName () const
 
void setCacheVersion (RE_CacheVersion v)
 
RE_CacheVersion getCacheVersion () const
 
void allowShared (bool shared)
 
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 UT_StringHolder &cachename)
 
void resetBuffer (bool delete_cached=false, bool mark_as_unused=true)
 
bool initialize (RE_Render *r, bool *created=nullptr)
 
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)
 
bool setCapacity (int cap)
 
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 ()
 
const fpreal64getConstant () const
 
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=nullptr)
 
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 getLengthScale () const
 
int getCapacity () 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_StringHolder &name) const
 
void getGLName (UT_StringHolder &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 UT_StringHolder &name, int num_elements=0, const char *cachename=nullptr, RE_ArrayType at=RE_ARRAY_POINT, int capacity=0)
 
static RE_VertexArraynewElementArray (int num_elements=0, const char *cachename=nullptr, int capacity=0)
 
static RE_VertexArraynewArrayContainer (RE_OGLBufferHandle &array, const char *cachename=nullptr, RE_ArrayType at=RE_ARRAY_POINT)
 
static RE_VertexArraynewArrayContainer (UT_Array< RE_OGLBufferHandle > &array, const char *cachename=nullptr, 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, int capacity=0)
 
 RE_VertexArray (const UT_StringHolder &name, int nelements=0, int capacity=0)
 
 RE_VertexArray (const RE_VertexArray &va)
 
void detachTexBuffer (int index)
 
void generateCacheName (UT_StringHolder &cachename, int index) const
 

Protected Attributes

UT_StringHolder myCacheName
 
UT_StringHolder myAttribName
 
RE_BufferType myBufferType
 
RE_GPUType myType
 
int myVectorSize
 
int myLength
 
int myLengthScale
 
int myCapacity
 
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
 
bool myAllowShared
 
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,
int  capacity = 0 
)
protected
RE_VertexArray::RE_VertexArray ( const UT_StringHolder name,
int  nelements = 0,
int  capacity = 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 UT_StringHolder cachename 
)
void RE_VertexArray::allowShared ( bool  shared)
inline

Definition at line 77 of file RE_VertexArray.h.

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 = nullptr 
)
bool RE_VertexArray::bindBuffer ( RE_Render r,
RE_BufferBinding  point,
int  index = 0,
int  array_index = 0 
)
void RE_VertexArray::cacheBuffer ( const UT_StringHolder name)
inline

Definition at line 69 of file RE_VertexArray.h.

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_StringHolder 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 302 of file RE_VertexArray.h.

RE_ArrayType RE_VertexArray::getArrayType ( ) const
inline

Definition at line 305 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 304 of file RE_VertexArray.h.

RE_BufferType RE_VertexArray::getBufferType ( ) const
inline

Definition at line 295 of file RE_VertexArray.h.

const char* RE_VertexArray::getCacheName ( ) const
inline

Definition at line 71 of file RE_VertexArray.h.

RE_CacheVersion RE_VertexArray::getCacheVersion ( ) const
int RE_VertexArray::getCapacity ( ) const
inline

Definition at line 300 of file RE_VertexArray.h.

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

Definition at line 296 of file RE_VertexArray.h.

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

Definition at line 329 of file RE_VertexArray.h.

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

Definition at line 311 of file RE_VertexArray.h.

int RE_VertexArray::getInstanceStride ( ) const
inline

Definition at line 310 of file RE_VertexArray.h.

int RE_VertexArray::getLength ( ) const
inline

Definition at line 298 of file RE_VertexArray.h.

int RE_VertexArray::getLengthScale ( ) const
inline

Definition at line 299 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 301 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 380 of file RE_VertexArray.h.

int RE_VertexArray::getVectorSize ( ) const
inline

Definition at line 297 of file RE_VertexArray.h.

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

Definition at line 307 of file RE_VertexArray.h.

bool RE_VertexArray::isDefaultValue ( ) const
inline

Definition at line 200 of file RE_VertexArray.h.

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

Definition at line 82 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 199 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 = nullptr,
RE_ArrayType  at = RE_ARRAY_POINT 
)
static
static RE_VertexArray* RE_VertexArray::newArrayContainer ( UT_Array< RE_OGLBufferHandle > &  array,
const char *  cachename = nullptr,
RE_ArrayType  at = RE_ARRAY_POINT 
)
static
static RE_VertexArray* RE_VertexArray::newAttribArray ( const UT_StringHolder name,
int  num_elements = 0,
const char *  cachename = nullptr,
RE_ArrayType  at = RE_ARRAY_POINT,
int  capacity = 0 
)
static
static RE_VertexArray* RE_VertexArray::newElementArray ( int  num_elements = 0,
const char *  cachename = nullptr,
int  capacity = 0 
)
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 159 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 164 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 147 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)
bool RE_VertexArray::setCapacity ( int  cap)
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 326 of file RE_VertexArray.h.

void RE_VertexArray::setInstanceGroup ( int  instance_group)
inline

Definition at line 142 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

bool RE_VertexArray::myAllowShared
protected

Definition at line 366 of file RE_VertexArray.h.

UT_Array<RE_OGLBufferHandle> RE_VertexArray::myArray
protected

Definition at line 350 of file RE_VertexArray.h.

RE_ArrayType RE_VertexArray::myArrayType
protected

Definition at line 360 of file RE_VertexArray.h.

UT_StringHolder RE_VertexArray::myAttribName
protected

Definition at line 342 of file RE_VertexArray.h.

RE_BufferType RE_VertexArray::myBufferType
protected

Definition at line 343 of file RE_VertexArray.h.

UT_StringHolder RE_VertexArray::myCacheName
protected

Definition at line 341 of file RE_VertexArray.h.

RE_CacheTagHandle RE_VertexArray::myCacheTagHandle
protected

Definition at line 353 of file RE_VertexArray.h.

int RE_VertexArray::myCapacity
protected

Definition at line 348 of file RE_VertexArray.h.

bool RE_VertexArray::myConstantFlag
protected

Definition at line 358 of file RE_VertexArray.h.

RE_OGLConstAttribute* RE_VertexArray::myConstAttrib
protected

Definition at line 352 of file RE_VertexArray.h.

bool RE_VertexArray::myDefaultValue
protected

Definition at line 365 of file RE_VertexArray.h.

RE_GenericAttribID RE_VertexArray::myGenID
protected

Definition at line 361 of file RE_VertexArray.h.

int RE_VertexArray::myInstanceGroup
protected

Definition at line 362 of file RE_VertexArray.h.

int RE_VertexArray::myInstanceStride
protected

Definition at line 349 of file RE_VertexArray.h.

bool RE_VertexArray::myInUse
protected

Definition at line 355 of file RE_VertexArray.h.

int RE_VertexArray::myLength
protected

Definition at line 346 of file RE_VertexArray.h.

int RE_VertexArray::myLengthScale
protected

Definition at line 347 of file RE_VertexArray.h.

bool RE_VertexArray::myMappedFlag[4]
protected

Definition at line 357 of file RE_VertexArray.h.

bool RE_VertexArray::myNormalizedFlag
protected

Definition at line 359 of file RE_VertexArray.h.

RE_PersistentBufferMode RE_VertexArray::myPersistentBufferMode
protected

Definition at line 363 of file RE_VertexArray.h.

bool RE_VertexArray::myPersistentMapCopied
protected

Definition at line 364 of file RE_VertexArray.h.

UT_Array<re_VertexArrayCB> RE_VertexArray::myRefs
protected

Definition at line 376 of file RE_VertexArray.h.

RE_GPUType RE_VertexArray::myType
protected

Definition at line 344 of file RE_VertexArray.h.

RE_BufferUsageHint RE_VertexArray::myUsage
protected

Definition at line 354 of file RE_VertexArray.h.

int RE_VertexArray::myVectorSize
protected

Definition at line 345 of file RE_VertexArray.h.

RE_OGLBufferHandle RE_VertexArray::theNullArray
staticprotected

Definition at line 351 of file RE_VertexArray.h.


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