OGRE-Next: Ogre::MetalDiscardBufferManager Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::MetalDiscardBufferManager Class Reference

Metal doesn't support "DISCARD" like D3D9/D3D11 (and OpenGL but often it's broken) where we requested to map a write-only buffer and the API would discard the previous contents (thus allowing us to avoid a stall until the GPU is done with the region). More...

`#include <OgreMetalDiscardBufferManager.h>`

Inheritance diagram for Ogre::MetalDiscardBufferManager:
[legend]

## Classes
struct | UnsafeBlock

## Public Types
typedef vector< UnsafeBlock >::type | UnsafeBlockVec

## Public Member Functions
| MetalDiscardBufferManager (MetalDevice *device, VaoManager *vaoManager)
| ~MetalDiscardBufferManager ()
void | _getBlock (MetalDiscardBuffer *discardBuffer)
| For internal use.
void | _notifyDeviceStalled ()
MetalDiscardBuffer * | createDiscardBuffer (size_t bufferSize, uint16 alignment)
| Creates a buffer that supports discarding to hold the required size.
void | destroyDiscardBuffer (MetalDiscardBuffer *discardBuffer)
| Destroys an existing MetalDiscardBuffer, releasing its memory.
MetalDevice * | getDevice () const
VaoManager * | getVaoManager () const

## Detailed Description

Metal doesn't support "DISCARD" like D3D9/D3D11 (and OpenGL but often it's broken) where we requested to map a write-only buffer and the API would discard the previous contents (thus allowing us to avoid a stall until the GPU is done with the region).

We need Discard for the v1 interfaces. So we need to emulate it. This class does exactly this.

## Member Typedef Documentation

## ◆ UnsafeBlockVec

typedef vector<UnsafeBlock>::type Ogre::MetalDiscardBufferManager::UnsafeBlockVec

## Constructor & Destructor Documentation

## ◆ MetalDiscardBufferManager()

Ogre::MetalDiscardBufferManager::MetalDiscardBufferManager | ( | MetalDevice * | device,
|  | VaoManager * | vaoManager )

## ◆ ~MetalDiscardBufferManager()

Ogre::MetalDiscardBufferManager::~MetalDiscardBufferManager | ( |  | ) |

## Member Function Documentation

## ◆ _getBlock()

void Ogre::MetalDiscardBufferManager::_getBlock | ( | MetalDiscardBuffer * | discardBuffer | ) |

For internal use.

Retrieves a fresh new block. The old block will be returned to a pool until it's safe to reuse again. Used by the DiscardBuffer when map( DISCARD ) is called.

Parameters

  discardBuffer | Buffer to assign a new region.

## ◆ _notifyDeviceStalled()

void Ogre::MetalDiscardBufferManager::_notifyDeviceStalled | ( |  | ) |

## ◆ createDiscardBuffer()

MetalDiscardBuffer * Ogre::MetalDiscardBufferManager::createDiscardBuffer | ( | size_t | bufferSize,
|  | uint16 | alignment )

Creates a buffer that supports discarding to hold the required size.

Parameters

  bufferSize | Requested size in bytes.
  alignment | Alignment requirements.

Returns
  A new MetalDiscardBuffer

## ◆ destroyDiscardBuffer()

void Ogre::MetalDiscardBufferManager::destroyDiscardBuffer | ( | MetalDiscardBuffer * | discardBuffer | ) |

Destroys an existing MetalDiscardBuffer, releasing its memory.

Parameters

  discardBuffer | MetalDiscardBuffer to destroy

## ◆ getDevice()

MetalDevice * Ogre::MetalDiscardBufferManager::getDevice | ( |  | ) | const
| inline

## ◆ getVaoManager()

VaoManager * Ogre::MetalDiscardBufferManager::getVaoManager | ( |  | ) | const
| inline

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

- OgreMetalDiscardBufferManager.h