OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::VertexBufferPacked Class Reference

#include <OgreVertexBufferPacked.h>

+ Inheritance diagram for Ogre::VertexBufferPacked:

Public Member Functions

 VertexBufferPacked (size_t internalBufferStartBytes, size_t numElements, uint32 bytesPerElement, uint32 numElementsPadding, BufferType bufferType, void *initialData, bool keepAsShadow, VaoManager *vaoManager, BufferInterface *bufferInterface, const VertexElement2Vec &vertexElements, size_t multiSourceId, MultiSourceVertexBufferPool *multiSourcePool, uint8 sourceIdx)
 
 ~VertexBufferPacked ()
 
size_t _getFinalBufferStart (void) const
 
size_t _getInternalBufferStart (void) const
 
size_t _getInternalNumElements (void) const
 
size_t _getInternalTotalSizeBytes (void) const
 
uint8 _getSourceIndex (void) const
 Source index reference assigned by the MultiSourceVertexBufferPool.
 
void _setBufferInterface (BufferInterface *bufferInterface)
 For internal use.
 
void _setShadowCopy (void *copy)
 This will not delete the existing shadow copy so it can be used for other purposes if it is not needed call OGRE_FREE_SIMD( m->getShadowCopy(), MEMCATEGORY_GEOMETRY ) before calling this function.
 
void advanceFrame (void)
 
BufferInterfacegetBufferInterface (void) const
 
virtual BufferPackedTypes getBufferPackedType (void) const
 Useful to query which one is the derived class.
 
BufferType getBufferType (void) const
 
size_t getBytesPerElement (void) const
 
MappingState getMappingState (void) const
 Returns the mapping state.
 
size_t getMultiSourceId (void)
 
MultiSourceVertexBufferPoolgetMultiSourcePool (void)
 Return value may be null.
 
size_t getNumElements (void) const
 
const voidgetShadowCopy (void) const
 
size_t getTotalSizeBytes (void) const
 
const VertexElement2VecgetVertexElements (void) const
 
bool isCurrentlyMapped (void) const
 Returns whether the buffer is currently mapped.
 
void *RESTRICT_ALIAS_RETURN map (size_t elementStart, size_t elementCount, bool bAdvanceFrame=true)
 Maps the specified region to a pointer the CPU can access.
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
voidoperator new (size_t sz)
 
voidoperator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info
 
voidoperator new (size_t sz, void *ptr)
 placement operator new
 
voidoperator new[] (size_t sz)
 
voidoperator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info
 
AsyncTicketPtr readRequest (size_t elementStart, size_t elementCount)
 Async data read request.
 
void regressFrame (void)
 Performs the opposite of.
 
void unmap (UnmapOptions unmapOption, size_t flushStartElem=0, size_t flushSizeElem=0)
 Unmaps or flushes the region mapped with.
 
virtual void upload (const void *data, size_t elementStart, size_t elementCount)
 Sends the provided data to the GPU.
 

Constructor & Destructor Documentation

◆ VertexBufferPacked()

Ogre::VertexBufferPacked::VertexBufferPacked ( size_t  internalBufferStartBytes,
size_t  numElements,
uint32  bytesPerElement,
uint32  numElementsPadding,
BufferType  bufferType,
void initialData,
bool  keepAsShadow,
VaoManager vaoManager,
BufferInterface bufferInterface,
const VertexElement2Vec vertexElements,
size_t  multiSourceId,
MultiSourceVertexBufferPool multiSourcePool,
uint8  sourceIdx 
)

◆ ~VertexBufferPacked()

Ogre::VertexBufferPacked::~VertexBufferPacked ( )

Member Function Documentation

◆ _getFinalBufferStart()

size_t Ogre::BufferPacked::_getFinalBufferStart ( void  ) const
inlineinherited

◆ _getInternalBufferStart()

size_t Ogre::BufferPacked::_getInternalBufferStart ( void  ) const
inlineinherited

◆ _getInternalNumElements()

size_t Ogre::BufferPacked::_getInternalNumElements ( void  ) const
inlineinherited

◆ _getInternalTotalSizeBytes()

size_t Ogre::BufferPacked::_getInternalTotalSizeBytes ( void  ) const
inlineinherited

◆ _getSourceIndex()

uint8 Ogre::VertexBufferPacked::_getSourceIndex ( void  ) const
inline

Source index reference assigned by the MultiSourceVertexBufferPool.

This value does not restrict the fact that you can actually assign this buffer to another index (as long as it's with another buffer with the same multisource ID and pool). This value is for internal use. Always 0 for non-multisource vertex buffers.

◆ _setBufferInterface()

void Ogre::BufferPacked::_setBufferInterface ( BufferInterface bufferInterface)
inherited

For internal use.

◆ _setShadowCopy()

void Ogre::BufferPacked::_setShadowCopy ( void copy)
inherited

This will not delete the existing shadow copy so it can be used for other purposes if it is not needed call OGRE_FREE_SIMD( m->getShadowCopy(), MEMCATEGORY_GEOMETRY ) before calling this function.

This will also not automatically upload the shadow data to the GPU. The user must call upload or use a staging buffer themselves to achieve this.

◆ advanceFrame()

void Ogre::BufferPacked::advanceFrame ( void  )
inherited

◆ getBufferInterface()

BufferInterface * Ogre::BufferPacked::getBufferInterface ( void  ) const
inlineinherited

◆ getBufferPackedType()

virtual BufferPackedTypes Ogre::VertexBufferPacked::getBufferPackedType ( void  ) const
inlinevirtual

Useful to query which one is the derived class.

Implements Ogre::BufferPacked.

References Ogre::BP_TYPE_VERTEX.

◆ getBufferType()

BufferType Ogre::BufferPacked::getBufferType ( void  ) const
inlineinherited

◆ getBytesPerElement()

size_t Ogre::BufferPacked::getBytesPerElement ( void  ) const
inlineinherited

◆ getMappingState()

MappingState Ogre::BufferPacked::getMappingState ( void  ) const
inlineinherited

Returns the mapping state.

Note that if you call map with MS_PERSISTENT_INCOHERENT or MS_PERSISTENT_COHERENT, then call unmap( UO_KEEP_PERSISTENT ); the returned value will still be MS_PERSISTENT_INCOHERENT/_COHERENT when persistent mapping is supported. This differs from isCurrentlyMapped

◆ getMultiSourceId()

size_t Ogre::VertexBufferPacked::getMultiSourceId ( void  )
inline

◆ getMultiSourcePool()

MultiSourceVertexBufferPool * Ogre::VertexBufferPacked::getMultiSourcePool ( void  )
inline

Return value may be null.

◆ getNumElements()

size_t Ogre::BufferPacked::getNumElements ( void  ) const
inlineinherited

◆ getShadowCopy()

const void * Ogre::BufferPacked::getShadowCopy ( void  ) const
inlineinherited

◆ getTotalSizeBytes()

size_t Ogre::BufferPacked::getTotalSizeBytes ( void  ) const
inlineinherited

◆ getVertexElements()

const VertexElement2Vec & Ogre::VertexBufferPacked::getVertexElements ( void  ) const
inline

◆ isCurrentlyMapped()

bool Ogre::BufferPacked::isCurrentlyMapped ( void  ) const
inherited

Returns whether the buffer is currently mapped.

If you've persistently mapped the buffer and then called unmap( UO_KEEP_PERSISTENT ); this function will return false; which differs from getMappingState's behavior.

◆ map()

void *RESTRICT_ALIAS_RETURN Ogre::BufferPacked::map ( size_t  elementStart,
size_t  elementCount,
bool  bAdvanceFrame = true 
)
inherited

Maps the specified region to a pointer the CPU can access.

Only dynamic buffers can use this function. The region [elementStart; elementStart + elementCount) will be mapped.

Remarks
You can only map once per frame, regardless of parameters (except for advanceFrame). map( 0, 1 ) followed by map( 1, 1 ); is invalid. If you plan modifying elements 0 and 1; you should call map( 0, 2 )
Note that even if you use persistent mapping, you still need to call
See also
unmap.
Parameters
elementStartStart of the region to be mapped, in elements. Normally you want this to be 0.
elementCountLength of the region to map, in elements.
See also
getNumElements to map the whole range. Can't be 0.
Parameters
bAdvanceFrameWhen true, the Buffer will be usable after unmapping it (or earlier if persistent mapped). However you won't be able to call map() again until the next frame. Calling this with false allows to call map multiple times. However ater calling unmap, you must call advanceFrame. THIS IS ONLY FOR VERY ADVANCED USERS.

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void ptr,
void  
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void ptr,
const char ,
int  ,
const char  
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void * Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char file,
int  line,
const char func 
)
inlineinherited

array operator new, with debug line info

◆ readRequest()

AsyncTicketPtr Ogre::BufferPacked::readRequest ( size_t  elementStart,
size_t  elementCount 
)
inherited

Async data read request.

A ticket will be returned. Once the async transfer finishes, you can use the ticket to read the data from CPU. @See AsyncTicket

◆ regressFrame()

void Ogre::BufferPacked::regressFrame ( void  )
inherited

◆ unmap()

void Ogre::BufferPacked::unmap ( UnmapOptions  unmapOption,
size_t  flushStartElem = 0,
size_t  flushSizeElem = 0 
)
inherited

Unmaps or flushes the region mapped with.

See also
map. Alternatively, you can flush a smaller region (i.e. you didn't know which regions you were to update when mapping, but now that you're done, you know). The region being flushed is [flushStart; flushStart + flushSize)
Parameters
unmapOptionWhen using persistent mapping, UO_KEEP_PERSISTENT will keep the map alive; but you will have to call map again to use it. This requirement allows Ogre to:
  1. Synchronize if needed (avoid mapping a region that is still in use)
  2. Emulate persistent mapping on Hardware/Drivers that don't support it.
flushStartElemIn elements, 0-based index (based on the mapped region) on where to start flushing from. Default is 0.
flushSizeElemThe length of the flushing region, which can't be bigger than 'elementCount' passed to
See also
map. When this value is 0, we flush until the end of the buffer starting from flushStartElem

◆ upload()

virtual void Ogre::BufferPacked::upload ( const void data,
size_t  elementStart,
size_t  elementCount 
)
virtualinherited

Sends the provided data to the GPU.

Parameters
dataThe data to transfer to the GPU. Caller is responsible for freeing the pointer. "data" starts at offset zero. i.e. dst[elementStart * mBytesPerElement] = data[0];
elementStartThe start region, usually zero.
elementCountSize, in number of elements, of data. Must be less than @getNumElements - elementStart

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