OGRE-Next
4.0.0unstable
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 | DirtyFlags { DirtyNone = 0u , DirtyConstBuffer = 1u << 0u , DirtyTextures = 1u << 1u , DirtySamplers = 1u << 2u } |
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. More... | |
void | releaseSlot (ConstBufferPoolUser *user) |
Releases a slot requested with requestSlot. More... | |
void | requestSlot (uint32 hash, ConstBufferPoolUser *user, bool wantsExtraBuffer) |
Requests a slot and fills 'user'. Automatically schedules for update. More... | |
void | scheduleForUpdate (ConstBufferPoolUser *dirtyUser, uint8 dirtyFlags=DirtyConstBuffer) |
virtual void | setOptimizationStrategy (OptimizationStrategy optimizationStrategy) |
Sets the optimization strategy. More... | |
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::HlmsUnlit, and Ogre::HlmsPbs.
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, |
uint8 | dirtyFlags = DirtyConstBuffer |
||
) |
|
virtual |
Sets the optimization strategy.
See OptimizationStrategy.
Reimplemented in Ogre::HlmsUnlit.