OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Represents constant buffers (also known as Uniform Buffers in GL) More...
#include <OgreConstBufferPacked.h>
Public Member Functions | |
ConstBufferPacked (size_t internalBufferStartBytes, size_t numElements, uint32 bytesPerElement, uint32 numElementsPadding, BufferType bufferType, void *initialData, bool keepAsShadow, VaoManager *vaoManager, BufferInterface *bufferInterface) | |
size_t | _getFinalBufferStart () const |
size_t | _getInternalBufferStart () const |
size_t | _getInternalNumElements () const |
size_t | _getInternalTotalSizeBytes () const |
void | _setBufferInterface (BufferInterface *bufferInterface) |
For internal use. More... | |
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. More... | |
void | advanceFrame () |
virtual void | bindBufferCS (uint16 slot)=0 |
virtual void | bindBufferDS (uint16 slot)=0 |
virtual void | bindBufferGS (uint16 slot)=0 |
virtual void | bindBufferHS (uint16 slot)=0 |
virtual void | bindBufferPS (uint16 slot)=0 |
virtual void | bindBufferVS (uint16 slot)=0 |
Binds the constant buffer to the given slot in the Vertex/Pixel/Geometry/Hull/Domain/Compute Shader. More... | |
void | copyTo (BufferPacked *dstBuffer, size_t dstElemStart=0, size_t srcElemStart=0, size_t srcNumElems=std::numeric_limits< size_t >::max()) |
Copies the contents of this buffer to another, using GPU -> GPU transfers. More... | |
BufferInterface * | getBufferInterface () const |
BufferPackedTypes | getBufferPackedType () const override |
Useful to query which one is the derived class. More... | |
BufferType | getBufferType () const |
size_t | getBytesPerElement () const |
MappingState | getMappingState () const |
Returns the mapping state. More... | |
size_t | getNumElements () const |
virtual BufferPacked * | getOriginalBufferType () |
If this buffer has been reinterpreted from an UavBufferPacked, returns the original version, otherwise returns 'this'. More... | |
const void * | getShadowCopy () const |
size_t | getTotalSizeBytes () const |
bool | isCurrentlyMapped () const |
Returns whether the buffer is currently mapped. More... | |
virtual bool | isTextureGpu () const |
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. More... | |
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 *) |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz) |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
AsyncTicketPtr | readRequest (size_t elementStart, size_t elementCount) |
Async data read request. More... | |
void | regressFrame () |
Performs the opposite of. More... | |
void | unmap (UnmapOptions unmapOption, size_t flushStartElem=0, size_t flushSizeElem=0) |
Unmaps or flushes the region mapped with. More... | |
virtual void | upload (const void *data, size_t elementStart, size_t elementCount) |
Sends the provided data to the GPU. More... | |
Represents constant buffers (also known as Uniform Buffers in GL)
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
For internal use.
|
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.
|
inherited |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Binds the constant buffer to the given slot in the Vertex/Pixel/Geometry/Hull/Domain/Compute Shader.
slot | The slot to asign this constant buffer. In D3D11 it's called 'slot'. In GLSL it's called it's called 'binding' |
Implemented in Ogre::VulkanConstBufferPacked, Ogre::MetalConstBufferPacked, Ogre::GL3PlusConstBufferPacked, Ogre::D3D11ConstBufferPacked, Ogre::NULLConstBufferPacked, and Ogre::GLES2ConstBufferPacked.
|
inherited |
Copies the contents of this buffer to another, using GPU -> GPU transfers.
In simple terms it is similar to doing: memcpy( dstBuffer + dstElemStart, this + srcElemStart, srcNumElems );
If dst has a shadow buffer, then src must have it too.
dstBuffer | Buffer to copy to. Must be of type BT_DEFAULT |
dstElemStart | The offset for dstBuffer. It must be in the unit of measure of dstBuffer. e.g. actual offset in bytes is dstElemStart * dstBuffer->getBytesPerElement() |
srcElemStart | The offset of this buffer to start from |
srcNumElems | The number of elements to copy, in units of measure of srcBuffer. When this value is out of bounds, it gets clamped. See remarks. |
|
inlineinherited |
|
inlineoverridevirtual |
Useful to query which one is the derived class.
Implements Ogre::BufferPacked.
References Ogre::BP_TYPE_CONST.
|
inlineinherited |
|
inlineinherited |
|
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
|
inlineinherited |
|
virtualinherited |
If this buffer has been reinterpreted from an UavBufferPacked, returns the original version, otherwise returns 'this'.
|
inlineinherited |
|
inlineinherited |
|
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.
|
inlinevirtualinherited |
Reimplemented in Ogre::TextureGpu.
|
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.
elementStart | Start of the region to be mapped, in elements. Normally you want this to be 0. |
elementCount | Length of the region to map, in elements. |
bAdvanceFrame | When 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. |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
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
|
inherited |
Performs the opposite of.
|
inherited |
Unmaps or flushes the region mapped with.
unmapOption | When 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:
|
flushStartElem | In elements, 0-based index (based on the mapped region) on where to start flushing from. Default is 0. |
flushSizeElem | The length of the flushing region, which can't be bigger than 'elementCount' passed to |
|
virtualinherited |
Sends the provided data to the GPU.
data | The 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]; |
elementStart | The start region, usually zero. |
elementCount | Size, in number of elements, of data. Must be less than @getNumElements - elementStart |