OGRE-Next  3.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::MetalDynamicBuffer Class Reference

Metal doesn't "map". More...

#include <OgreMetalDynamicBuffer.h>

Public Member Functions

 MetalDynamicBuffer (id< MTLBuffer > vboName, size_t vboSize)
 ~MetalDynamicBuffer ()
void flush (size_t ticket, size_t start, size_t count)
 Flushes the region of the given ticket. start is 0-based. More...
id< MTLBuffer > getVboName () const
void *RESTRICT_ALIAS_RETURN map (size_t start, size_t count, size_t &outTicket)
void unmap (size_t ticket)
 Unmaps given ticket (got from. More...

Detailed Description

Metal doesn't "map".

You can directly access the unsynchronized contents 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 treats mapping in a GL-style. The most usefulness is that in OS X we need to inform what regions were modified (flush). On iOS it serves no real purpose and is just a pass through with some asserts for consistency checking.
This is a very thin/lightweight wrapper around MTLBuffer, thus: Caller is responsible for flushing regions before unmapping. Caller is responsible for proper synchronization. No check is performed to see if two map calls overlap.

Constructor & Destructor Documentation

◆ MetalDynamicBuffer()

Ogre::MetalDynamicBuffer::MetalDynamicBuffer ( id< MTLBuffer >  vboName,
size_t  vboSize 

◆ ~MetalDynamicBuffer()

Ogre::MetalDynamicBuffer::~MetalDynamicBuffer ( )

Member Function Documentation

◆ flush()

void Ogre::MetalDynamicBuffer::flush ( size_t  ticket,
size_t  start,
size_t  count 

Flushes the region of the given ticket. start is 0-based.

◆ getVboName()

id<MTLBuffer> Ogre::MetalDynamicBuffer::getVboName ( ) const

◆ map()

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

◆ unmap()

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

Unmaps given ticket (got from.

See also
map). The ticket becomes invalid after this.

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