OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
Vulkan 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 <OgreVulkanDiscardBufferManager.h>
Classes | |
struct | UnsafeBlock |
Public Types | |
typedef vector< UnsafeBlock >::type | UnsafeBlockVec |
Public Member Functions | |
VulkanDiscardBufferManager (VulkanDevice *device, VaoManager *vaoManager) | |
~VulkanDiscardBufferManager () | |
void | _getBlock (VulkanDiscardBuffer *discardBuffer) |
For internal use. More... | |
void | _notifyDeviceStalled () |
VulkanDiscardBuffer * | createDiscardBuffer (size_t bufferSize, uint16 alignment) |
Creates a buffer that supports discarding to hold the required size. More... | |
void | destroyDiscardBuffer (VulkanDiscardBuffer *discardBuffer) |
Destroys an existing VulkanDiscardBuffer, releasing its memory. More... | |
VulkanRawBuffer & | getBuffer () |
VulkanDevice * | getDevice () const |
VaoManager * | getVaoManager () const |
Vulkan 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.
typedef vector<UnsafeBlock>::type Ogre::VulkanDiscardBufferManager::UnsafeBlockVec |
Ogre::VulkanDiscardBufferManager::VulkanDiscardBufferManager | ( | VulkanDevice * | device, |
VaoManager * | vaoManager | ||
) |
Ogre::VulkanDiscardBufferManager::~VulkanDiscardBufferManager | ( | ) |
void Ogre::VulkanDiscardBufferManager::_getBlock | ( | VulkanDiscardBuffer * | 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.
discardBuffer | Buffer to assign a new region. |
void Ogre::VulkanDiscardBufferManager::_notifyDeviceStalled | ( | ) |
VulkanDiscardBuffer* Ogre::VulkanDiscardBufferManager::createDiscardBuffer | ( | size_t | bufferSize, |
uint16 | alignment | ||
) |
Creates a buffer that supports discarding to hold the required size.
bufferSize | Requested size in bytes. |
alignment | Alignment requirements. |
void Ogre::VulkanDiscardBufferManager::destroyDiscardBuffer | ( | VulkanDiscardBuffer * | discardBuffer | ) |
Destroys an existing VulkanDiscardBuffer, releasing its memory.
discardBuffer | VulkanDiscardBuffer to destroy |
|
inline |
|
inline |
|
inline |