OGRE-Next: Ogre::VaoManager Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::VaoManager Class Referenceabstract

`#include <OgreVaoManager.h>`

Inheritance diagram for Ogre::VaoManager:
[legend]

## Classes
struct | MemoryStatsEntry

## Public Types
typedef vector< MemoryStatsEntry >::type | MemoryStatsEntryVec

## Public Member Functions
| VaoManager (const NameValuePairList *params)
virtual | ~VaoManager ()
virtual void | _beginFrame ()
uint8 | _getDynamicBufferCurrentFrameNoWait () const
void | _notifyStagingBufferEnteredZeroRef (StagingBuffer *stagingBuffer)
void | _notifyStagingBufferLeftZeroRef (StagingBuffer *stagingBuffer)
virtual void | _update ()
virtual void | _waitUntilCommitedCommandBufferCompleted ()
| Waits for the last committed command buffer completion instead of the last frame completion with command buffer switching, so we can continue to work with current command buffer.
virtual void | cleanupEmptyPools ()=0
| Frees GPU memory if there are empty, unused pools.
virtual AsyncTicketPtr | createAsyncTicket (BufferPacked *creator, StagingBuffer *stagingBuffer, size_t elementStart, size_t elementCount)=0
ConstBufferPacked * | createConstBuffer (size_t sizeBytes, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates an constant buffer based on the given parameters.
IndexBufferPacked * | createIndexBuffer (IndexBufferPacked::IndexType indexType, size_t numIndices, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates an index buffer based on the given parameters.
IndirectBufferPacked * | createIndirectBuffer (size_t sizeBytes, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates an indirect buffer.
ReadOnlyBufferPacked * | createReadOnlyBuffer (PixelFormatGpu pixelFormat, size_t sizeBytes, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates a read-only buffer based on the given parameters.
virtual StagingBuffer * | createStagingBuffer (size_t sizeBytes, bool forUpload)=0
| Creates a new staging buffer and adds it to the pool.
TexBufferPacked * | createTexBuffer (PixelFormatGpu pixelFormat, size_t sizeBytes, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates an constant buffer based on the given parameters.
UavBufferPacked * | createUavBuffer (size_t numElements, uint32 bytesPerElement, uint32 bindFlags, void *initialData, bool keepAsShadow)
| Creates an UAV buffer based on the given parameters.
VertexArrayObject * | createVertexArrayObject (const VertexBufferPackedVec &vertexBuffers, IndexBufferPacked *indexBuffer, OperationType opType)
| Creates a VertexArrayObject that binds all the vertex buffers with their respective declarations, and the index buffers.
VertexBufferPacked * | createVertexBuffer (const VertexElement2Vec &vertexElements, size_t numVertices, BufferType bufferType, void *initialData, bool keepAsShadow)
| Creates a vertex buffer based on the given parameters.
void | deleteStagingBuffers ()
void | destroyConstBuffer (ConstBufferPacked *constBuffer)
| Destroys the given constant buffer created with createConstBuffer.
void | destroyIndexBuffer (IndexBufferPacked *indexBuffer)
| Destroys the given index buffer created with createIndexBuffer.
void | destroyIndirectBuffer (IndirectBufferPacked *indirectBuffer)
| Destroys the given indirect buffer created with createIndirectBuffer.
void | destroyReadOnlyBuffer (ReadOnlyBufferPacked *readOnlyBuffer)
| Destroys the given texture buffer created with createReadOnlyBuffer.
void | destroyTexBuffer (TexBufferPacked *texBuffer)
| Destroys the given texture buffer created with createTexBuffer.
void | destroyUavBuffer (UavBufferPacked *uavBuffer)
| Destroys the given UAV buffer created with createUavBuffer.
void | destroyVertexArrayObject (VertexArrayObject *vao)
| Destroys the input pointer.
void | destroyVertexBuffer (VertexBufferPacked *vertexBuffer)
| Destroys the given vertex buffer created with createVertexBuffer.
uint32 | getConstBufferAlignment () const
size_t | getConstBufferMaxSize () const
uint32 | getDefaultStagingBufferLifetime () const
uint32 | getDefaultStagingBufferUnfencedTime () const
uint8 | getDynamicBufferMultiplier () const
uint32 | getFrameCount ()
virtual void | getMemoryStats (MemoryStatsEntryVec &outStats, size_t &outCapacityBytes, size_t &outFreeBytes, Log *log, bool &outIncludesTextures) const =0
| Retrieves memory stats about our GPU pools being managed.
size_t | getReadOnlyBufferMaxSize () const
StagingBuffer * | getStagingBuffer (size_t minSizeBytes, bool forUpload)
| Retrieves a staging buffer for use.
uint32 | getTexBufferAlignment () const
size_t | getTexBufferMaxSize () const
Timer * | getTimer ()
uint32 | getUavBufferAlignment () const
size_t | getUavBufferMaxSize () const
virtual bool | isFrameFinished (uint32 frameCount)=0
| If this returns true, then waitForSpecificFrameToFinish is guaranteed to return immediately.
bool | readOnlyIsTexBuffer () const
| When true, ReadOnlyBufferPacked behaves like TexBufferPacked, i.e.
void | setDefaultStagingBufferlifetime (uint32 lifetime, uint32 unfencedTime)
| Sets the default time for staging buffers.
bool | supportsBaseInstance () const
bool | supportsIndirectBuffers () const
| When false, IndirectBufferPacked will emulate the mapping behavior, and we need to use the emulated calls in RenderSystem.
bool | supportsPersistentMapping () const
virtual void | waitForSpecificFrameToFinish (uint32 frameCount)=0
| Waits for a specific frame to be ready.
virtual uint8 | waitForTailFrameToFinish ()=0
| Returns the current frame # (which wraps to 0 every mDynamicBufferMultiplier times).

## Static Public Member Functions
static uint32 | calculateVertexSize (const VertexElement2Vec &vertexElements)
| Returns the size of a single vertex buffer source with the given declaration, in bytes.

## Member Typedef Documentation

## ◆ MemoryStatsEntryVec

typedef vector<MemoryStatsEntry>::type Ogre::VaoManager::MemoryStatsEntryVec

## Constructor & Destructor Documentation

## ◆ VaoManager()

Ogre::VaoManager::VaoManager | ( | const NameValuePairList * | params | ) |

## ◆ ~VaoManager()

virtual Ogre::VaoManager::~VaoManager | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ _beginFrame()

virtual void Ogre::VaoManager::_beginFrame | ( |  | ) |
| inlinevirtual

Reimplemented in Ogre::D3D11VaoManager.

## ◆ _getDynamicBufferCurrentFrameNoWait()

uint8 Ogre::VaoManager::_getDynamicBufferCurrentFrameNoWait | ( |  | ) | const
| inline

## ◆ _notifyStagingBufferEnteredZeroRef()

void Ogre::VaoManager::_notifyStagingBufferEnteredZeroRef | ( | StagingBuffer * | stagingBuffer | ) |

## ◆ _notifyStagingBufferLeftZeroRef()

void Ogre::VaoManager::_notifyStagingBufferLeftZeroRef | ( | StagingBuffer * | stagingBuffer | ) |

## ◆ _update()

virtual void Ogre::VaoManager::_update | ( |  | ) |
| virtual

Reimplemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ _waitUntilCommitedCommandBufferCompleted()

virtual void Ogre::VaoManager::_waitUntilCommitedCommandBufferCompleted | ( |  | ) |
| inlinevirtual

Waits for the last committed command buffer completion instead of the last frame completion with command buffer switching, so we can continue to work with current command buffer.

It's required for BT_DEFAULT_SHARED buffers upload

Remarks
  BT_DEFAULT_SHARED were designed for rare uploads. Nevertheless if we need to upload new data we have to be sure that last committed command buffer's completed to avoid artefacts due to data changing on the go. Indeed on some heavy scenes gpu may still execute last committed command buffer that uses BT_DEFAULT_SHARED vertex/index buffers when we come to upload some new data. Of cause we can wait for previous frame completion using waitForSpecificFrameToFinish(), but waitForSpecificFrameToFinish(vaoManager->getFrameCount()) leads to stall() call which is more slow: switches current command buffer and notify everyone with _notifyDeviceStalled() call. So _waitUntilCommitedCommandBufferCompleted() is more lightweight aspecially for Metal render system

Reimplemented in Ogre::MetalVaoManager.

## ◆ calculateVertexSize()

uint32 Ogre::VaoManager::calculateVertexSize | ( | const VertexElement2Vec & | vertexElements | ) |
| static

Returns the size of a single vertex buffer source with the given declaration, in bytes.

## ◆ cleanupEmptyPools()

virtual void Ogre::VaoManager::cleanupEmptyPools | ( |  | ) |
| pure virtual

Frees GPU memory if there are empty, unused pools.

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ createAsyncTicket()

virtual AsyncTicketPtr Ogre::VaoManager::createAsyncTicket | ( | BufferPacked * | creator,
|  | StagingBuffer * | stagingBuffer,
|  | size_t | elementStart,
|  | size_t | elementCount )
| pure virtual

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ createConstBuffer()

ConstBufferPacked * Ogre::VaoManager::createConstBuffer | ( | size_t | sizeBytes,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates an constant buffer based on the given parameters.

Behind the scenes, the buffer is actually part of much larger buffer, in order to reduce bindings at runtime. (depends on the RenderSystem, on D3D11 we're forced to give its own buffer)

Remarks
  See createVertexBuffer() for the remaining parameters not documented here.

Parameters

  sizeBytes | The size in bytes of the given constant buffer. API restrictions may apply. To stay safe keep it multiple of 16, don't request more than 64kb per buffer.

Returns
  The desired const buffer pointer

## ◆ createIndexBuffer()

IndexBufferPacked * Ogre::VaoManager::createIndexBuffer | ( | IndexBufferPacked::IndexType | indexType,
|  | size_t | numIndices,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates an index buffer based on the given parameters.

Behind the scenes, the buffer is actually part of much larger buffer, in order to reduce bindings at runtime.

Remarks
  See createVertexBuffer() for the remaining parameters not documented here.

Parameters

  indexType | Whether this Index Buffer should be 16-bit (recommended) or 32-bit
  numIndices | The number of indices

Returns
  The desired index buffer pointer

## ◆ createIndirectBuffer()

IndirectBufferPacked * Ogre::VaoManager::createIndirectBuffer | ( | size_t | sizeBytes,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates an indirect buffer.

Remarks
  See createVertexBuffer() for the remaining parameters not documented here.

## ◆ createReadOnlyBuffer()

ReadOnlyBufferPacked * Ogre::VaoManager::createReadOnlyBuffer | ( | PixelFormatGpu | pixelFormat,
|  | size_t | sizeBytes,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates a read-only buffer based on the given parameters.

Behind the scenes, the buffer is actually part of much larger buffer, in order to reduce bindings at runtime. (depends on the RenderSystem, on D3D11 we're forced to give its own buffer)

Remarks
  See VaoManager::createVertexBuffer for the remaining parameters not documented here.

Parameters

  pixelFormat | The pixel format for the texture buffer.
  sizeBytes | The size in bytes of the given constant buffer. API restrictions may apply.

Returns
  The desired read-only buffer pointer

## ◆ createStagingBuffer()

virtual StagingBuffer * Ogre::VaoManager::createStagingBuffer | ( | size_t | sizeBytes,
|  | bool | forUpload )
| pure virtual

Creates a new staging buffer and adds it to the pool.

See also
  getStagingBuffer.

Remarks
  The returned buffer starts with a reference count of 1. You should decrease it when you're done using it.

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ createTexBuffer()

TexBufferPacked * Ogre::VaoManager::createTexBuffer | ( | PixelFormatGpu | pixelFormat,
|  | size_t | sizeBytes,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates an constant buffer based on the given parameters.

Behind the scenes, the buffer is actually part of much larger buffer, in order to reduce bindings at runtime. (depends on the RenderSystem, on D3D11 we're forced to give its own buffer)

Remarks
  See createVertexBuffer() for the remaining parameters not documented here.

Parameters

  pixelFormat | The pixel format for the texture buffer.
  sizeBytes | The size in bytes of the given constant buffer. API restrictions may apply.

Returns
  The desired texture buffer pointer

## ◆ createUavBuffer()

UavBufferPacked * Ogre::VaoManager::createUavBuffer | ( | size_t | numElements,
|  | uint32 | bytesPerElement,
|  | uint32 | bindFlags,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates an UAV buffer based on the given parameters.

Behind the scenes, the buffer is actually part of much larger buffer, in order to reduce bindings at runtime. (depends on the RenderSystem, on D3D11 we're forced to give its own buffer)

Remarks
  See createVertexBuffer() for the remaining parameters not documented here. There is no BufferType option as the only available one is BT_DEFAULT

Parameters

  sizeBytes | The size in bytes of the given constant buffer. API restrictions may apply.
  bindFlags | A combination of BufferBindFlags. BB_FLAG_UAV is implicit.

Returns
  The desired UAV buffer pointer

## ◆ createVertexArrayObject()

VertexArrayObject * Ogre::VaoManager::createVertexArrayObject | ( | const VertexBufferPackedVec & | vertexBuffers,
|  | IndexBufferPacked * | indexBuffer,
|  | OperationType | opType )

Creates a VertexArrayObject that binds all the vertex buffers with their respective declarations, and the index buffers.

The returned value is immutable and thus cannot be modified.

Parameters

  vertexBuffers | An array of vertex buffers to be bound to the vertex array object.
  indexBuffer | The index buffer to be bound.
  opType | Type of operation. Cannot be changed later.

Returns
  VertexArrayObject that can be rendered.

## ◆ createVertexBuffer()

VertexBufferPacked * Ogre::VaoManager::createVertexBuffer | ( | const VertexElement2Vec & | vertexElements,
|  | size_t | numVertices,
|  | BufferType | bufferType,
|  | void * | initialData,
|  | bool | keepAsShadow )

Creates a vertex buffer based on the given parameters.

Behind the scenes, the vertex buffer is part of much larger vertex buffer, in order to reduce bindings at runtime.

Parameters

  vertexElements | A list of element bindings for this vertex buffer. Once created, changing VertexElements is not possible, you'll have to create another Vertex Buffer.
  numVertices | The number of vertices for this vertex
  bufferType | The type of buffer for this vertex buffer. See BT_DYNAMIC_DEFAULT special case.
  initialData | Initial data the buffer will hold upon creation. Can be null (i.e. you plan to upload later). Cannot be null when bufferType is BT_IMMUTABLE. Must have enough room to prevent an overflow. See BufferPacked::BufferPacked
  keepAsShadow | Whether to keep the pointer "initialData" as a shadow copy of the contents. See BufferPacked::BufferPacked regarding on who is responsible for freeing this pointer and what happens if an exception was raised.

Returns
  The desired vertex buffer pointer

## ◆ deleteStagingBuffers()

void Ogre::VaoManager::deleteStagingBuffers | ( |  | ) |

## ◆ destroyConstBuffer()

void Ogre::VaoManager::destroyConstBuffer | ( | ConstBufferPacked * | constBuffer | ) |

Destroys the given constant buffer created with createConstBuffer.

Parameters

  constBuffer | Constant Buffer created with createConstBuffer

## ◆ destroyIndexBuffer()

void Ogre::VaoManager::destroyIndexBuffer | ( | IndexBufferPacked * | indexBuffer | ) |

Destroys the given index buffer created with createIndexBuffer.

Parameters

  indexBuffer | Index Buffer created with createIndexBuffer

## ◆ destroyIndirectBuffer()

void Ogre::VaoManager::destroyIndirectBuffer | ( | IndirectBufferPacked * | indirectBuffer | ) |

Destroys the given indirect buffer created with createIndirectBuffer.

Parameters

  indirectBuffer | Indirect Buffer created with createIndirectBuffer

## ◆ destroyReadOnlyBuffer()

void Ogre::VaoManager::destroyReadOnlyBuffer | ( | ReadOnlyBufferPacked * | readOnlyBuffer | ) |

Destroys the given texture buffer created with createReadOnlyBuffer.

Parameters

  readOnlyBuffer | ReadOnlyBufferPacked created with createReadOnlyBuffer

## ◆ destroyTexBuffer()

void Ogre::VaoManager::destroyTexBuffer | ( | TexBufferPacked * | texBuffer | ) |

Destroys the given texture buffer created with createTexBuffer.

Parameters

  texBuffer | Texture Buffer created with createTexBuffer

## ◆ destroyUavBuffer()

void Ogre::VaoManager::destroyUavBuffer | ( | UavBufferPacked * | uavBuffer | ) |

Destroys the given UAV buffer created with createUavBuffer.

Parameters

  uavBuffer | Uav Buffer created with createUavBuffer

## ◆ destroyVertexArrayObject()

void Ogre::VaoManager::destroyVertexArrayObject | ( | VertexArrayObject * | vao | ) |

Destroys the input pointer.

After this call, it's no longer valid

Remarks
  API memory may or may not be released since VertexArrayObjects may internally share the same API constructs.

  The vertex & index buffers associated with this vao are not destroyed by this function.

## ◆ destroyVertexBuffer()

void Ogre::VaoManager::destroyVertexBuffer | ( | VertexBufferPacked * | vertexBuffer | ) |

Destroys the given vertex buffer created with createVertexBuffer.

NOTE: Vertex Buffers created by a MultiSourceVertexBufferPool must be freed by the pool that created it, don't use this function for those.

Remarks
  Performs an O(N) lookup. Where N is the number of created vertex buffers

## ◆ getConstBufferAlignment()

uint32 Ogre::VaoManager::getConstBufferAlignment | ( |  | ) | const
| inline

## ◆ getConstBufferMaxSize()

size_t Ogre::VaoManager::getConstBufferMaxSize | ( |  | ) | const
| inline

## ◆ getDefaultStagingBufferLifetime()

uint32 Ogre::VaoManager::getDefaultStagingBufferLifetime | ( |  | ) | const
| inline

## ◆ getDefaultStagingBufferUnfencedTime()

uint32 Ogre::VaoManager::getDefaultStagingBufferUnfencedTime | ( |  | ) | const
| inline

## ◆ getDynamicBufferMultiplier()

uint8 Ogre::VaoManager::getDynamicBufferMultiplier | ( |  | ) | const
| inline

## ◆ getFrameCount()

uint32 Ogre::VaoManager::getFrameCount | ( |  | ) |
| inline

## ◆ getMemoryStats()

virtual void Ogre::VaoManager::getMemoryStats | ( | MemoryStatsEntryVec & | outStats,
|  | size_t & | outCapacityBytes,
|  | size_t & | outFreeBytes,
|  | Log * | log,
|  | bool & | outIncludesTextures ) const
| pure virtual

Retrieves memory stats about our GPU pools being managed.

The output in the Log will be csv data that resembles the following: Pool Type Offset Bytes Pool Capacity CPU_INACCESSIBLE 0 148128 67108864 CPU_INACCESSIBLE 200000 1024 67108864 CPU_ACCESSIBLE_PERSISTENT 0 1152 16777216

These are the chunks of memory currently in use. If there are multiple entries belonging to the same pool, that means the memory has been fragmented.

The actual output may vary depending on the RenderSystem.

Remarks
  Worst case scenario this function has O(N^2) complexity where N is the number of free blocks.

Parameters

  outStats | Detailed information about each entry.
  outCapacityBytes | Total capacity i.e. total used VRAM in GPU.
  outFreeBytes | Total free memory available for consumption.
  log | Optional to dump all information to a CSV file. Nullptr to avoid dumping.
  outIncludesTextures | [out] When true, memory reports in outCapacityBytes & outFreeBytes include textures. See Tutorial_Memory on how to deal with this output.

Note outIncludesTextures may be false but some entries in outStats[n].bPoolHasTextures may be true. If this happens, then outCapacityBytes & outFreeBytes don't include texture consumption; but the pools with bPoolHasTextures in MemoryStatsEntryVec may.

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ getReadOnlyBufferMaxSize()

size_t Ogre::VaoManager::getReadOnlyBufferMaxSize | ( |  | ) | const
| inline

## ◆ getStagingBuffer()

StagingBuffer * Ogre::VaoManager::getStagingBuffer | ( | size_t | minSizeBytes,
|  | bool | forUpload )

Retrieves a staging buffer for use.

We'll search for existing ones that can hold minSizeBytes. We first prioritize those that won't cause a stall at all. Then those that will cause a partial stall, and otherwise return one that will cause full stall. If we can't find any existing buffer that can hold the requested number bytes, we'll create a new one.

Remarks
  Calling this function causes the reference count of the returned pointer to be increased. You should decrease the reference count after you're done with the returned pointer. See StagingBuffer::removeReferenceCount regarding ref. counting.

Parameters

  minSizeBytes | Minimum size, in bytes, of the staging buffer. The returned buffer may be bigger.
  forUpload | True if it should be used to upload data to GPU, false to download.

Returns
  The staging buffer.

## ◆ getTexBufferAlignment()

uint32 Ogre::VaoManager::getTexBufferAlignment | ( |  | ) | const
| inline

## ◆ getTexBufferMaxSize()

size_t Ogre::VaoManager::getTexBufferMaxSize | ( |  | ) | const
| inline

## ◆ getTimer()

Timer * Ogre::VaoManager::getTimer | ( |  | ) |
| inline

## ◆ getUavBufferAlignment()

uint32 Ogre::VaoManager::getUavBufferAlignment | ( |  | ) | const
| inline

## ◆ getUavBufferMaxSize()

size_t Ogre::VaoManager::getUavBufferMaxSize | ( |  | ) | const
| inline

## ◆ isFrameFinished()

virtual bool Ogre::VaoManager::isFrameFinished | ( | uint32 | frameCount | ) |
| pure virtual

If this returns true, then waitForSpecificFrameToFinish is guaranteed to return immediately.

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ readOnlyIsTexBuffer()

bool Ogre::VaoManager::readOnlyIsTexBuffer | ( |  | ) | const
| inline

When true, ReadOnlyBufferPacked behaves like TexBufferPacked, i.e.

assigned to texture buffer slots.

When false, ReadOnlyBufferPacked behaves like UavBufferPacked i.e. assigned to UAV buffer slots. Except D3D11, which still uses texture buffer slots when false but chooses StructuredBuffer over Buffer

## ◆ setDefaultStagingBufferlifetime()

void Ogre::VaoManager::setDefaultStagingBufferlifetime | ( | uint32 | lifetime,
|  | uint32 | unfencedTime )

Sets the default time for staging buffers.

Staging buffers are recycled/reused. When their reference count reaches 0, this VaoManager will begin to track how long since the last time they've reached ref count 0. When the time threshold is met, the staging buffer gets removed.

Remarks
  See getStagingBuffer

  Small explanation on StagingBuffer lifetime management (so you can make sense on what we're doing here):

StagingBuffers may produce "pops" when created (due to API/driver stalls) so we reuse them. We keep track of how long StagingBuffers have been remained unused, and delete old ones. The intention is to be able to recycle old buffers, while getting rid of the excess if a sudden spike happened. That's what the lifetime threshold controls.

We also have the "unfenced threshold". This controls something very different. StagingBuffers usages need fences to check whether we're done using the buffer. But we don't issue a fence every time you do something with them, because that could result in a lot of fences (i.e. imagine you do a 1000 uploads of 16 bytes each, in succession, we shouldn't do 1000 fences); so we fence when certain upload/download thresholds are met (i.e. you've uploaded 1MB of data). So if you've uploaded 750kb so far, no fence will be issued. But if you upload 300kb more, we will fence. But what happens if you've only uploaded 750kb and then nothing more for the last 10 minutes? Since we haven't fenced, and now you need to upload a lot more, we don't know if those 750kb are done uploading because we never fenced it. It probably ended 10 minutes ago, but we won't know. We would have to fence now and perform a full stall waiting for that fence. To solve this edge case, we fence whenever X time has elapsed without fencing (and only if there's data that remains unfenced of course). That's what the unfenced threshold is for.

Parameters

  lifetime | Time in milliseconds. The default is 5 minutes. A staging buffer that remained at zero ref. count for lifetime milliseconds will be destroyed.
  unfencedTime | For efficiency reasons (API overhead), some staging buffers implementations will not track all hazards on fences. A staging buffer that remained at zero ref. count for unfencedTime milliseconds will be told to clean their hazards, creating the missing appropiate fences. unfencedTime can't be higher than lifetime. unfencedTime should not be too far away from lifetime, and not too soon either, to maximize the chances of no stalls when we finally destroy it and avoid excessive API overhead in keeping fences alive. The default is 4 minutes 59 seconds.

## ◆ supportsBaseInstance()

bool Ogre::VaoManager::supportsBaseInstance | ( |  | ) | const
| inline

## ◆ supportsIndirectBuffers()

bool Ogre::VaoManager::supportsIndirectBuffers | ( |  | ) | const
| inline

When false, IndirectBufferPacked will emulate the mapping behavior, and we need to use the emulated calls in RenderSystem.

Referenced by Ogre::D3D11VaoManager::D3D11VaoManager(), and Ogre::GL3PlusVaoManager::GL3PlusVaoManager().

## ◆ supportsPersistentMapping()

bool Ogre::VaoManager::supportsPersistentMapping | ( |  | ) | const
| inline

## ◆ waitForSpecificFrameToFinish()

virtual void Ogre::VaoManager::waitForSpecificFrameToFinish | ( | uint32 | frameCount | ) |
| pure virtual

Waits for a specific frame to be ready.

Calling waitForSpecificFrameToFinish( mFrameCount - mDynamicBufferMultiplier ) equals to calling waitForTailFrameToFinish.

Remarks
  WARNING: calling waitForSpecificFrameToFinish( mFrameCount ); will perform a full stall!

  Avoid calling this function. Some implementations may decide to always full stall unless (mFrameCount - frameCount) >= mDynamicBufferMultiplier

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

## ◆ waitForTailFrameToFinish()

virtual uint8 Ogre::VaoManager::waitForTailFrameToFinish | ( |  | ) |
| pure virtual

Returns the current frame # (which wraps to 0 every mDynamicBufferMultiplier times).

But first stalls until that mDynamicBufferMultiplier-1 frame behind is finished.

Implemented in Ogre::D3D11VaoManager, Ogre::GL3PlusVaoManager, Ogre::GLES2VaoManager, Ogre::MetalVaoManager, Ogre::NULLVaoManager, and Ogre::VulkanVaoManager.

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

- OgreVaoManager.h