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

#include <RE_OGLBuffer.h>

+ Inheritance diagram for RE_OGLBuffer:

Public Member Functions

 RE_OGLBuffer (RE_BufferType type, int num_elements, int capacity=-1)
 
void setBufferType (RE_BufferType type)
 
void setAttributeName (const char *attrib)
 
bool setFormat (RE_GPUType type, int vectorsize)
 
void setNormalizedFormat (bool normalize=true)
 
bool setLength (int len)
 
bool setCapacity (int size)
 
void setInstanceStride (int nprim)
 
void setUsage (RE_BufferUsageHint hint)
 
void setPersistentBuffer (RE_PersistentBufferMode mode)
 
void setSubComponentIndex (int index)
 
void setLabel (RE_Render *, const char *)
 
bool setData (RE_Render *r, const void *data, int offset=0, int sublen=0)
 
bool replaceData (RE_Render *r, const void *subdata, int suboffset, int sublength)
 
bool getData (RE_Render *, void *data, int offset=0, int sublen=0) const
 
void orphan (RE_Render *r)
 
virtual bool enable (RE_Render *r, unsigned int stride=0, bool geo_object=false)
 
virtual bool disable (RE_Render *r)
 
bool rebindAttrib (RE_Render *r, int location, int stride=-1, RE_GPUType *type=nullptr)
 
bool unbindAttrib (RE_Render *r)
 
bool bindBuffer (RE_Render *r, RE_BufferBinding point, int bind_index=0)
 
bool unbindBuffer (RE_Render *r, RE_BufferBinding point, int bind_index=0)
 
virtual void draw (RE_Render *r, RE_PrimType prim, unsigned int stride, int num_instanced, int vertices_per_patch)
 
virtual void drawRange (RE_Render *r, RE_PrimType prim, int start, int num, int num_instanced, int vertices_per_patch)
 
virtual void drawElements (RE_Render *r, RE_PrimType prim, RE_OGLBuffer *index_array, int offset, int num, int num_instanced, int vertices_per_patch)
 
voidmap (RE_Render *r, RE_BufferAccess access=RE_BUFFER_WRITE_ONLY)
 
voidmapRange (RE_Render *r, int offset, int length, RE_BufferAccess access=RE_BUFFER_WRITE_ONLY)
 
void unmap (RE_Render *r)
 
voidgetPersistentMap () const
 
int64 getSizeBytes () const
 Graphics memory usage estimate. More...
 
int64 getMemoryUsage (bool inclusive) const override
 Returns the amount of main memory owned by this RE_OGLBuffer. More...
 
RE_BufferType getBufferType () const
 
RE_GPUType getDataType () const
 
int getVectorSize () const
 
int getSubComponentIndex () const
 
int getLength () const
 
int getCapacity () const
 
int getInstanceStride () const
 
const char * getAttributeName () const
 
bool isBound () const
 
bool isMapped () const
 
bool isEnabled () const
 
RE_BufferAccess getMapAccess () const
 
int getID () const
 
uint32 getBufferOffset () const
 
uint32 getBufferSize () const
 
bool isBufferShared () const
 
int getUniqueID () const
 
bool setEnabled (bool enabled)
 
void incref ()
 
void decref ()
 
int getRefCount () const
 
void setTBO (RE_OGLTexture *tbo)
 
RE_OGLTexturegetTBO () const
 
void allowSharedBuffer (bool b=true)
 
void commitMappedData (RE_Render *r)
 
void markAsUsed ()
 
void markAsUnused ()
 
bool isUsed () const
 
int getUseCount () const
 
- Public Member Functions inherited from RE_CachedObjectBase
 RE_CachedObjectBase ()
 
virtual ~RE_CachedObjectBase ()
 
void setVersion (RE_CacheVersion v)
 
RE_CacheVersion getVersion () const
 
void setExtraData (RE_CachedExtraData *data)
 
const RE_CachedExtraDataHandlegetExtraData () const
 
void setCacheTag (RE_CacheTagHandle h)
 
void resetCacheTag ()
 
void setInCache (bool c)
 
bool isInCache () const
 

Static Public Member Functions

static RE_OGLBuffernewBuffer (RE_BufferType type, int num_elements, const char *name=nullptr, int capacity=-1)
 
static int getMaxVertexArraySize (RE_Render *r)
 
static int getMaxElementArraySize (RE_Render *r)
 

Protected Member Functions

bool initialize (RE_Render *r, const void *data, int length=0)
 
void resetBuffer ()
 
void drawArraysCommon (RE_Render *r, RE_PrimType prim, int start, int num, unsigned int stride, int num_instances, int vertices_per_patch)
 
bool bindAttribute (RE_Render *r, int location, RE_GPUType type, int stride, const void *data)
 
bool enableAttribArray (RE_Render *r, const char *name, RE_GPUType datatype, int vectorsize, unsigned int stride, const void *data)
 
void disableAttribArray (RE_Render *r, const char *name)
 
 ~RE_OGLBuffer () override
 

Protected Attributes

UT_String myAttribName
 
RE_BufferType myBufferType
 
RE_GPUType myType
 
int myVectorSize
 
int mySubIndex
 
int myNormalized
 
int myLength
 
int myCapacity
 
int myInstanceStride
 
int myLastStride
 
int myAttribLocation
 
RE_BufferUsageHint myUsage
 
RE_PersistentBufferMode myPersistentBufferMode
 
RE_BufferAccess myMappedAccess
 
bool myMappedFlag
 
bool myBoundFlag
 
bool myEnableFlag
 
GLenum myDataType
 
int myDataSize
 
GLuint myBufferID
 
GLuint myBufferOffset
 
GLuint myBufferSize
 
bool myBufferShared
 
bool myAllowSharedBuffer
 
GLenum myGLBufferType
 
voidmyMappedDataEnd
 
voidmyMappedPersistentData
 
RE_OGLTexturemyTBO
 
int64 myRefCount
 
int myUseCount
 
int myUniqueID
 

Additional Inherited Members

- Public Attributes inherited from RE_CachedObjectBase
RE_CacheVersion myVersion
 
RE_CacheTagHandle myCacheTagHandle
 
bool myCachedFlag
 
RE_CachedExtraDataHandle myExtraData
 

Detailed Description

Definition at line 100 of file RE_OGLBuffer.h.

Constructor & Destructor Documentation

RE_OGLBuffer::RE_OGLBuffer ( RE_BufferType  type,
int  num_elements,
int  capacity = -1 
)
RE_OGLBuffer::~RE_OGLBuffer ( )
overrideprotected

Member Function Documentation

void RE_OGLBuffer::allowSharedBuffer ( bool  b = true)
inline

Definition at line 307 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::bindAttribute ( RE_Render r,
int  location,
RE_GPUType  type,
int  stride,
const void data 
)
protected
bool RE_OGLBuffer::bindBuffer ( RE_Render r,
RE_BufferBinding  point,
int  bind_index = 0 
)
void RE_OGLBuffer::commitMappedData ( RE_Render r)
void RE_OGLBuffer::decref ( )
inline

Definition at line 296 of file RE_OGLBuffer.h.

virtual bool RE_OGLBuffer::disable ( RE_Render r)
virtual

Reimplemented in RE_OGLVertexBuffer.

void RE_OGLBuffer::disableAttribArray ( RE_Render r,
const char *  name 
)
protected
virtual void RE_OGLBuffer::draw ( RE_Render r,
RE_PrimType  prim,
unsigned int  stride,
int  num_instanced,
int  vertices_per_patch 
)
virtual

Reimplemented in RE_OGLVertexBuffer.

void RE_OGLBuffer::drawArraysCommon ( RE_Render r,
RE_PrimType  prim,
int  start,
int  num,
unsigned int  stride,
int  num_instances,
int  vertices_per_patch 
)
protected
virtual void RE_OGLBuffer::drawElements ( RE_Render r,
RE_PrimType  prim,
RE_OGLBuffer index_array,
int  offset,
int  num,
int  num_instanced,
int  vertices_per_patch 
)
virtual

Reimplemented in RE_OGLVertexBuffer.

virtual void RE_OGLBuffer::drawRange ( RE_Render r,
RE_PrimType  prim,
int  start,
int  num,
int  num_instanced,
int  vertices_per_patch 
)
virtual

Reimplemented in RE_OGLVertexBuffer.

virtual bool RE_OGLBuffer::enable ( RE_Render r,
unsigned int  stride = 0,
bool  geo_object = false 
)
virtual

Reimplemented in RE_OGLCopyPixelBuffer, and RE_OGLVertexBuffer.

bool RE_OGLBuffer::enableAttribArray ( RE_Render r,
const char *  name,
RE_GPUType  datatype,
int  vectorsize,
unsigned int  stride,
const void data 
)
protected
const char* RE_OGLBuffer::getAttributeName ( ) const
inline

Definition at line 270 of file RE_OGLBuffer.h.

uint32 RE_OGLBuffer::getBufferOffset ( ) const
inline

Definition at line 278 of file RE_OGLBuffer.h.

uint32 RE_OGLBuffer::getBufferSize ( ) const
inline

Definition at line 279 of file RE_OGLBuffer.h.

RE_BufferType RE_OGLBuffer::getBufferType ( ) const
inline

Definition at line 263 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getCapacity ( ) const
inline

Definition at line 268 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::getData ( RE_Render ,
void data,
int  offset = 0,
int  sublen = 0 
) const
RE_GPUType RE_OGLBuffer::getDataType ( ) const
inline

Definition at line 264 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getID ( ) const
inline

Definition at line 277 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getInstanceStride ( ) const
inline

Definition at line 269 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getLength ( ) const
inline

Definition at line 267 of file RE_OGLBuffer.h.

RE_BufferAccess RE_OGLBuffer::getMapAccess ( ) const
inline

Definition at line 274 of file RE_OGLBuffer.h.

static int RE_OGLBuffer::getMaxElementArraySize ( RE_Render r)
static
static int RE_OGLBuffer::getMaxVertexArraySize ( RE_Render r)
static
int64 RE_OGLBuffer::getMemoryUsage ( bool  inclusive) const
inlineoverridevirtual

Returns the amount of main memory owned by this RE_OGLBuffer.

Reimplemented from RE_CachedObjectBase.

Reimplemented in RE_OGLVertexBuffer.

Definition at line 255 of file RE_OGLBuffer.h.

void* RE_OGLBuffer::getPersistentMap ( ) const
inline

Definition at line 248 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getRefCount ( ) const
inline

Definition at line 302 of file RE_OGLBuffer.h.

int64 RE_OGLBuffer::getSizeBytes ( ) const

Graphics memory usage estimate.

int RE_OGLBuffer::getSubComponentIndex ( ) const
inline

Definition at line 266 of file RE_OGLBuffer.h.

RE_OGLTexture* RE_OGLBuffer::getTBO ( ) const
inline

Definition at line 305 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getUniqueID ( ) const
inline

Definition at line 283 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getUseCount ( ) const
inline

Definition at line 314 of file RE_OGLBuffer.h.

int RE_OGLBuffer::getVectorSize ( ) const
inline

Definition at line 265 of file RE_OGLBuffer.h.

void RE_OGLBuffer::incref ( )
inline

Definition at line 295 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::initialize ( RE_Render r,
const void data,
int  length = 0 
)
protected
bool RE_OGLBuffer::isBound ( ) const
inline

Definition at line 271 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::isBufferShared ( ) const
inline

Definition at line 280 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::isEnabled ( ) const
inline

Definition at line 273 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::isMapped ( ) const
inline

Definition at line 272 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::isUsed ( ) const
inline

Definition at line 313 of file RE_OGLBuffer.h.

void* RE_OGLBuffer::map ( RE_Render r,
RE_BufferAccess  access = RE_BUFFER_WRITE_ONLY 
)
void* RE_OGLBuffer::mapRange ( RE_Render r,
int  offset,
int  length,
RE_BufferAccess  access = RE_BUFFER_WRITE_ONLY 
)
void RE_OGLBuffer::markAsUnused ( )
inline

Definition at line 312 of file RE_OGLBuffer.h.

void RE_OGLBuffer::markAsUsed ( )
inline

Definition at line 311 of file RE_OGLBuffer.h.

static RE_OGLBuffer* RE_OGLBuffer::newBuffer ( RE_BufferType  type,
int  num_elements,
const char *  name = nullptr,
int  capacity = -1 
)
static
void RE_OGLBuffer::orphan ( RE_Render r)
bool RE_OGLBuffer::rebindAttrib ( RE_Render r,
int  location,
int  stride = -1,
RE_GPUType type = nullptr 
)
bool RE_OGLBuffer::replaceData ( RE_Render r,
const void subdata,
int  suboffset,
int  sublength 
)
inline

Definition at line 176 of file RE_OGLBuffer.h.

void RE_OGLBuffer::resetBuffer ( )
protected
void RE_OGLBuffer::setAttributeName ( const char *  attrib)
void RE_OGLBuffer::setBufferType ( RE_BufferType  type)
bool RE_OGLBuffer::setCapacity ( int  size)
bool RE_OGLBuffer::setData ( RE_Render r,
const void data,
int  offset = 0,
int  sublen = 0 
)
bool RE_OGLBuffer::setEnabled ( bool  enabled)
inline

Definition at line 291 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::setFormat ( RE_GPUType  type,
int  vectorsize 
)
void RE_OGLBuffer::setInstanceStride ( int  nprim)
void RE_OGLBuffer::setLabel ( RE_Render ,
const char *   
)
bool RE_OGLBuffer::setLength ( int  len)
void RE_OGLBuffer::setNormalizedFormat ( bool  normalize = true)
void RE_OGLBuffer::setPersistentBuffer ( RE_PersistentBufferMode  mode)
void RE_OGLBuffer::setSubComponentIndex ( int  index)
void RE_OGLBuffer::setTBO ( RE_OGLTexture tbo)
void RE_OGLBuffer::setUsage ( RE_BufferUsageHint  hint)
bool RE_OGLBuffer::unbindAttrib ( RE_Render r)
bool RE_OGLBuffer::unbindBuffer ( RE_Render r,
RE_BufferBinding  point,
int  bind_index = 0 
)
void RE_OGLBuffer::unmap ( RE_Render r)

Member Data Documentation

bool RE_OGLBuffer::myAllowSharedBuffer
protected

Definition at line 365 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myAttribLocation
protected

Definition at line 350 of file RE_OGLBuffer.h.

UT_String RE_OGLBuffer::myAttribName
protected

Definition at line 340 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::myBoundFlag
protected

Definition at line 356 of file RE_OGLBuffer.h.

GLuint RE_OGLBuffer::myBufferID
protected

Definition at line 361 of file RE_OGLBuffer.h.

GLuint RE_OGLBuffer::myBufferOffset
protected

Definition at line 362 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::myBufferShared
protected

Definition at line 364 of file RE_OGLBuffer.h.

GLuint RE_OGLBuffer::myBufferSize
protected

Definition at line 363 of file RE_OGLBuffer.h.

RE_BufferType RE_OGLBuffer::myBufferType
protected

Definition at line 341 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myCapacity
protected

Definition at line 347 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myDataSize
protected

Definition at line 360 of file RE_OGLBuffer.h.

GLenum RE_OGLBuffer::myDataType
protected

Definition at line 359 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::myEnableFlag
protected

Definition at line 357 of file RE_OGLBuffer.h.

GLenum RE_OGLBuffer::myGLBufferType
protected

Definition at line 366 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myInstanceStride
protected

Definition at line 348 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myLastStride
protected

Definition at line 349 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myLength
protected

Definition at line 346 of file RE_OGLBuffer.h.

RE_BufferAccess RE_OGLBuffer::myMappedAccess
protected

Definition at line 353 of file RE_OGLBuffer.h.

void* RE_OGLBuffer::myMappedDataEnd
protected

Definition at line 368 of file RE_OGLBuffer.h.

bool RE_OGLBuffer::myMappedFlag
protected

Definition at line 355 of file RE_OGLBuffer.h.

void* RE_OGLBuffer::myMappedPersistentData
protected

Definition at line 369 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myNormalized
protected

Definition at line 345 of file RE_OGLBuffer.h.

RE_PersistentBufferMode RE_OGLBuffer::myPersistentBufferMode
protected

Definition at line 352 of file RE_OGLBuffer.h.

int64 RE_OGLBuffer::myRefCount
protected

Definition at line 371 of file RE_OGLBuffer.h.

int RE_OGLBuffer::mySubIndex
protected

Definition at line 344 of file RE_OGLBuffer.h.

RE_OGLTexture* RE_OGLBuffer::myTBO
protected

Definition at line 370 of file RE_OGLBuffer.h.

RE_GPUType RE_OGLBuffer::myType
protected

Definition at line 342 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myUniqueID
protected

Definition at line 374 of file RE_OGLBuffer.h.

RE_BufferUsageHint RE_OGLBuffer::myUsage
protected

Definition at line 351 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myUseCount
protected

Definition at line 372 of file RE_OGLBuffer.h.

int RE_OGLBuffer::myVectorSize
protected

Definition at line 343 of file RE_OGLBuffer.h.


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