OGRE  1.12.12
Object-Oriented Graphics Rendering Engine
Ogre::MetalStagingBuffer Class Reference

A staging buffer is a buffer that resides on the GPU and be written to/from both CPU & GPU However the access in both cases is limited. More...

#include <OgreMetalStagingBuffer.h>

Public Member Functions

 MetalStagingBuffer (size_t internalBufferStart, size_t sizeBytes, bool uploadOnly, id< MTLBuffer > vboName, MetalDevice *device)
 
virtual ~MetalStagingBuffer ()
 
virtual size_t _asyncDownloadV1 (MetalHardwareBufferCommon *source, size_t srcOffset, size_t srcLength)
 
const void * _mapForRead (size_t offset, size_t sizeBytes)
 
void _notifyDeviceStalled (void)
 
void _unmapToV1 (MetalHardwareBufferCommon *hwBuffer, size_t lockStart, size_t lockSize)
 
void cleanUnfencedHazards (void)
 
id< MTLBuffer > getBufferName (void) const
 
void * map (size_t sizeBytes)
 Maps the given amount of bytes. More...
 
virtual StagingStallType uploadWillStall (size_t sizeBytes)
 

Detailed Description

A staging buffer is a buffer that resides on the GPU and be written to/from both CPU & GPU However the access in both cases is limited.

GPUs can only copy (i.e. memcpy) to another real buffer (can't be used directly as i.e. texture or vertex buffer) and CPUs can only map it. In other words, a staging buffer is an intermediate buffer to transfer data between CPU & GPU

Constructor & Destructor Documentation

◆ MetalStagingBuffer()

Ogre::MetalStagingBuffer::MetalStagingBuffer ( size_t  internalBufferStart,
size_t  sizeBytes,
bool  uploadOnly,
id< MTLBuffer >  vboName,
MetalDevice device 
)

◆ ~MetalStagingBuffer()

virtual Ogre::MetalStagingBuffer::~MetalStagingBuffer ( )
virtual

Member Function Documentation

◆ uploadWillStall()

virtual StagingStallType Ogre::MetalStagingBuffer::uploadWillStall ( size_t  sizeBytes)
virtual

◆ cleanUnfencedHazards()

void Ogre::MetalStagingBuffer::cleanUnfencedHazards ( void  )

◆ _notifyDeviceStalled()

void Ogre::MetalStagingBuffer::_notifyDeviceStalled ( void  )

◆ _unmapToV1()

void Ogre::MetalStagingBuffer::_unmapToV1 ( MetalHardwareBufferCommon hwBuffer,
size_t  lockStart,
size_t  lockSize 
)

◆ _asyncDownloadV1()

virtual size_t Ogre::MetalStagingBuffer::_asyncDownloadV1 ( MetalHardwareBufferCommon source,
size_t  srcOffset,
size_t  srcLength 
)
virtual

◆ getBufferName()

id<MTLBuffer> Ogre::MetalStagingBuffer::getBufferName ( void  ) const
inline

◆ _mapForRead()

const void* Ogre::MetalStagingBuffer::_mapForRead ( size_t  offset,
size_t  sizeBytes 
)

◆ map()

void* Ogre::MetalStagingBuffer::map ( size_t  sizeBytes)

Maps the given amount of bytes.

May block if not ready.

See also
uploadWillStall if you wish to know.
Remarks
Will throw if sizeBytes > this->getMaxSize()

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