OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::VulkanDiscardBufferManager Class Reference

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>

+ Inheritance diagram for Ogre::VulkanDiscardBufferManager:

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 ()
 
VulkanDiscardBuffercreateDiscardBuffer (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...
 
VulkanRawBuffergetBuffer ()
 
VulkanDevicegetDevice () const
 
VaoManagergetVaoManager () const
 
void operator delete (void *ptr)
 
void operator delete (void *ptr, const char *, int, const char *)
 
void operator delete (void *ptr, void *)
 
void operator delete[] (void *ptr)
 
void operator delete[] (void *ptr, const char *, int, const char *)
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, const char *file, int line, const char *func)
 operator new, with debug line info More...
 
void * operator new (size_t sz, void *ptr)
 placement operator new More...
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, const char *file, int line, const char *func)
 array operator new, with debug line info More...
 

Detailed Description

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.

Member Typedef Documentation

◆ UnsafeBlockVec

Constructor & Destructor Documentation

◆ VulkanDiscardBufferManager()

Ogre::VulkanDiscardBufferManager::VulkanDiscardBufferManager ( VulkanDevice device,
VaoManager vaoManager 
)

◆ ~VulkanDiscardBufferManager()

Ogre::VulkanDiscardBufferManager::~VulkanDiscardBufferManager ( )

Member Function Documentation

◆ _getBlock()

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.

Parameters
discardBufferBuffer to assign a new region.

◆ _notifyDeviceStalled()

void Ogre::VulkanDiscardBufferManager::_notifyDeviceStalled ( )

◆ createDiscardBuffer()

VulkanDiscardBuffer* Ogre::VulkanDiscardBufferManager::createDiscardBuffer ( size_t  bufferSize,
uint16  alignment 
)

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

Parameters
bufferSizeRequested size in bytes.
alignmentAlignment requirements.
Returns
A new VulkanDiscardBuffer

◆ destroyDiscardBuffer()

void Ogre::VulkanDiscardBufferManager::destroyDiscardBuffer ( VulkanDiscardBuffer discardBuffer)

Destroys an existing VulkanDiscardBuffer, releasing its memory.

Parameters
discardBufferVulkanDiscardBuffer to destroy

◆ getBuffer()

VulkanRawBuffer& Ogre::VulkanDiscardBufferManager::getBuffer ( )
inline

◆ getDevice()

VulkanDevice* Ogre::VulkanDiscardBufferManager::getDevice ( ) const
inline

◆ getVaoManager()

VaoManager* Ogre::VulkanDiscardBufferManager::getVaoManager ( ) const
inline

◆ operator delete() [1/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr)
inlineinherited

◆ operator delete() [2/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator delete() [3/3]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete ( void *  ptr,
void *   
)
inlineinherited

◆ operator delete[]() [1/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr)
inlineinherited

◆ operator delete[]() [2/2]

template<class Alloc >
void Ogre::AllocatedObject< Alloc >::operator delete[] ( void *  ptr,
const char *  ,
int  ,
const char *   
)
inlineinherited

◆ operator new() [1/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz)
inlineinherited

◆ operator new() [2/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

operator new, with debug line info

◆ operator new() [3/3]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new ( size_t  sz,
void *  ptr 
)
inlineinherited

placement operator new

◆ operator new[]() [1/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz)
inlineinherited

◆ operator new[]() [2/2]

template<class Alloc >
void* Ogre::AllocatedObject< Alloc >::operator new[] ( size_t  sz,
const char *  file,
int  line,
const char *  func 
)
inlineinherited

array operator new, with debug line info


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