OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::D3D11DynamicBuffer Class Referencefinal

D3D11 doesn't support mapping the same buffer twice even if the regions don't overlap. More...

#include <OgreD3D11DynamicBuffer.h>

+ Inheritance diagram for Ogre::D3D11DynamicBuffer:

Public Member Functions

 D3D11DynamicBuffer (ID3D11Buffer *vboName, size_t vboSize, D3D11Device &device)
 
 ~D3D11DynamicBuffer ()
 
ID3D11Buffer * getVboName () const
 
void *RESTRICT_ALIAS_RETURN map (size_t start, size_t count, size_t &outTicket)
 Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!! More...
 
void unmap (size_t ticket)
 Unmaps given ticket (got from. More...
 

Detailed Description

D3D11 doesn't support mapping the same buffer twice even if the regions don't overlap.

For performance we keep many buffers as one big buffer, but for compatibility reasons (with GL3/DX10 HW) we treat them as separate buffers.

This class takes care of mapping buffers once while allowing BufferInterface to map subregions of it as if they were separate buffers.
Remarks
This is a very thin/lightweight wrapper around D3D11's Map, thus: Caller is responsible for unmapping. Caller is responsible for proper synchronization. No check is performed to see if two map calls overlap.

Constructor & Destructor Documentation

◆ D3D11DynamicBuffer()

Ogre::D3D11DynamicBuffer::D3D11DynamicBuffer ( ID3D11Buffer *  vboName,
size_t  vboSize,
D3D11Device device 
)

◆ ~D3D11DynamicBuffer()

Ogre::D3D11DynamicBuffer::~D3D11DynamicBuffer ( )

Member Function Documentation

◆ getVboName()

ID3D11Buffer* Ogre::D3D11DynamicBuffer::getVboName ( ) const
inline

◆ map()

void* RESTRICT_ALIAS_RETURN Ogre::D3D11DynamicBuffer::map ( size_t  start,
size_t  count,
size_t &  outTicket 
)

Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!!

◆ unmap()

void Ogre::D3D11DynamicBuffer::unmap ( size_t  ticket)

Unmaps given ticket (got from.

See also
map). Assumes mVboName is already bound to GL_COPY_WRITE_BUFFER!!! The ticket becomes invalid after this.

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