OGRE
2.2.4
Object-Oriented Graphics Rendering Engine
|
#include <OgreGpuResource.h>
Public Member Functions | |
GpuResource (GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy, VaoManager *vaoManager, IdString name) | |
virtual | ~GpuResource () |
void | _addPendingResidencyChanges (uint32 value) |
void | _setNextResidencyStatus (GpuResidency::GpuResidency nextResidency) |
GpuPageOutStrategy::GpuPageOutStrategy | getGpuPageOutStrategy (void) const |
IdString | getName (void) const |
virtual String | getNameStr (void) const |
Retrieves a user-friendly name. More... | |
GpuResidency::GpuResidency | getNextResidencyStatus (void) const |
When getResidencyStatus() != getNextResidencyStatus(), residency changes happen in the main thread, while some preparation may be happening in the background. More... | |
uint32 | getPendingResidencyChanges (void) const |
Returns the number of pending residency changes. More... | |
GpuResidency::GpuResidency | getResidencyStatus (void) const |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
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 * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void * | operator new[] (size_t sz) |
Ogre::GpuResource::GpuResource | ( | GpuPageOutStrategy::GpuPageOutStrategy | pageOutStrategy, |
VaoManager * | vaoManager, | ||
IdString | name | ||
) |
|
virtual |
void Ogre::GpuResource::_addPendingResidencyChanges | ( | uint32 | value | ) |
void Ogre::GpuResource::_setNextResidencyStatus | ( | GpuResidency::GpuResidency | nextResidency | ) |
GpuPageOutStrategy::GpuPageOutStrategy Ogre::GpuResource::getGpuPageOutStrategy | ( | void | ) | const |
IdString Ogre::GpuResource::getName | ( | void | ) | const |
|
virtual |
Retrieves a user-friendly name.
May involve a look up. NOT THREAD SAFE. ONLY CALL FROM MAIN THREAD.
Reimplemented in Ogre::TextureGpu.
GpuResidency::GpuResidency Ogre::GpuResource::getNextResidencyStatus | ( | void | ) | const |
When getResidencyStatus() != getNextResidencyStatus(), residency changes happen in the main thread, while some preparation may be happening in the background.
For example when a texture is not resident but getNextResidencyStatus says it will, a background thread is loading the texture file from disk, but the actual transition won't happen until the main thread changes it. You can call texture->waitForData() which will stall, as the main thread will be communicating back and forth with the background to see if it's ready; and when it is, the main thread will perform the transition inside waitForData
Likewise, if that texture is resident but will soon not be, it is still legal to access its contents as long as you access them from the main thread before that main thread changes the residency. This gives you a strong serialization guarantee, but be careful with async tickets such as AsyncTextureTickets:
If you call AsyncTextureTicket *asyncTicket = textureManager->createAsyncTextureTicket( ... ); assert( texture->getResidencyStatus() == GpuResidency::Resident ); ... do something else that calls Ogre functionality ... assert( texture->getResidencyStatus() == GpuResidency::Resident ); asyncTicket->download( texture, mip, true ); Then the second assert may trigger because that "do something else" ended up calling a function inside Ogre that finalized the transition. Once you've called download and the resource was still Resident, you are safe that your data integrity will be kept.
uint32 Ogre::GpuResource::getPendingResidencyChanges | ( | void | ) | const |
Returns the number of pending residency changes.
Residency changes may not be immediate and thus be delayed (e.g. see TextureGpu::scheduleTransitionTo).
When this value is 0 it implies that mResidencyStatus == mNextResidencyStatus
GpuResidency::GpuResidency Ogre::GpuResource::getResidencyStatus | ( | void | ) | const |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
|
inlineinherited |
placement operator new
|
inlineinherited |
array operator new, with debug line info
|
inlineinherited |