OGRE 2.1
Object-Oriented Graphics Rendering Engine
|
Maintains a pool of buffers grouped by hash ID. More...
#include <OgreConstBufferPool.h>
Classes | |
struct | BufferPool |
struct | ExtraBufferParams |
Public Types | |
enum | OptimizationStrategy { LowerCpuOverhead , LowerGpuOverhead } |
Public Member Functions | |
ConstBufferPool (uint32 bytesPerSlot, const ExtraBufferParams &extraBufferParams) | |
virtual | ~ConstBufferPool () |
virtual void | _changeRenderSystem (RenderSystem *newRs) |
OptimizationStrategy | getOptimizationStrategy () const |
size_t | getPoolIndex (ConstBufferPoolUser *user) const |
Gets an ID corresponding to the pool this user was assigned to, unique per hash. | |
void | releaseSlot (ConstBufferPoolUser *user) |
Releases a slot requested with requestSlot. | |
void | requestSlot (uint32 hash, ConstBufferPoolUser *user, bool wantsExtraBuffer) |
Requests a slot and fills 'user'. Automatically schedules for update. | |
void | scheduleForUpdate (ConstBufferPoolUser *dirtyUser) |
virtual void | setOptimizationStrategy (OptimizationStrategy optimizationStrategy) |
Sets the optimization strategy. | |
Maintains a pool of buffers grouped by hash ID.
Keeping them separated by hash prevents mixing materials in the same buffer (which has limited space) that could never be batched together in the same draw call.
When a buffer is full and has used all of its free slots, a new buffer is allocated.
Ogre::ConstBufferPool::ConstBufferPool | ( | uint32 | bytesPerSlot, |
const ExtraBufferParams & | extraBufferParams | ||
) |
|
virtual |
|
virtual |
Reimplemented in Ogre::HlmsPbs, and Ogre::HlmsUnlit.
OptimizationStrategy Ogre::ConstBufferPool::getOptimizationStrategy | ( | ) | const |
size_t Ogre::ConstBufferPool::getPoolIndex | ( | ConstBufferPoolUser * | user | ) | const |
Gets an ID corresponding to the pool this user was assigned to, unique per hash.
void Ogre::ConstBufferPool::releaseSlot | ( | ConstBufferPoolUser * | user | ) |
Releases a slot requested with requestSlot.
void Ogre::ConstBufferPool::requestSlot | ( | uint32 | hash, |
ConstBufferPoolUser * | user, | ||
bool | wantsExtraBuffer | ||
) |
Requests a slot and fills 'user'. Automatically schedules for update.
void Ogre::ConstBufferPool::scheduleForUpdate | ( | ConstBufferPoolUser * | dirtyUser | ) |
|
virtual |
Sets the optimization strategy.
See OptimizationStrategy.
Reimplemented in Ogre::HlmsUnlit.