![]() |
OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
#include <OgreGL3PlusTextureGpu.h>
Public Member Functions | |
GL3PlusTextureGpuRenderTarget (GpuPageOutStrategy::GpuPageOutStrategy pageOutStrategy, VaoManager *vaoManager, IdString name, uint32 textureFlags, TextureTypes::TextureTypes initialType, TextureGpuManager *textureManager) | |
~GL3PlusTextureGpuRenderTarget () override | |
void | _addPendingResidencyChanges (uint32 value) |
void | _autogenerateMipmaps (CopyEncTransitionMode::CopyEncTransitionMode transitionMode=CopyEncTransitionMode::Auto) override |
Tells the API to let the HW autogenerate mipmaps. More... | |
uint8 * | _getSysRamCopy (uint8 mipLevel) |
TextureBox | _getSysRamCopyAsBox (uint8 mipLevel) |
size_t | _getSysRamCopyBytesPerImage (uint8 mipLevel) |
Note: Returns non-zero even if there is no system ram copy. More... | |
size_t | _getSysRamCopyBytesPerRow (uint8 mipLevel) |
Note: Returns non-zero even if there is no system ram copy. More... | |
bool | _isDataReadyImpl () const override |
For internal use. More... | |
bool | _isManualTextureFlagPresent () const |
void | _notifySysRamDownloadIsReady (uint8 *sysRamPtr, bool resyncOnly) |
Do not call directly. More... | |
void | _notifyTextureSlotChanged (const TexturePool *newPool, uint16 slice) override |
void | _resetTextureManager () |
void | _resolveTo (TextureGpu *resolveTexture) |
Immediately resolves this texture to the resolveTexture argument. More... | |
void | _setDepthBufferDefaults (uint16 depthBufferPoolId, bool preferDepthTexture, PixelFormatGpu desiredDepthBufferFormat) override |
These 3 values are used as defaults for the compositor to use, but they may be explicitly overriden by a RenderPassDescriptor. More... | |
virtual void | _setNextLayout (ResourceLayout::Layout layout) |
Sets the layout the texture should be transitioned to after the next copy operation (once the copy encoder gets closed) More... | |
void | _setNextResidencyStatus (GpuResidency::GpuResidency nextResidency) |
void | _setSampleDescription (SampleDescription desc, SampleDescription validatedSampleDesc) |
For internal use. More... | |
void | _setSourceType (uint8 type) |
void | _setToDisplayDummyTexture () override |
void | _syncGpuResidentToSystemRam () |
Forces downloading data from GPU to CPU, usually because the data on GPU changed and we're in strategy AlwaysKeepSystemRamCopy. More... | |
void | _transitionTo (GpuResidency::GpuResidency newResidency, uint8 *sysRamCopy, bool autoDeleteSysRamCopy=true) |
This function may be called manually (if user is manually managing a texture) or automatically (e.g. More... | |
void | addListener (TextureGpuListener *listener) |
bool | allowsAutoMipmaps () const |
void | copyContentsToMemory (TextureBox src, TextureBox dst, PixelFormatGpu dstFormat, bool automaticResolve=true) |
Writes the current contents of the render target to the memory. More... | |
void | copyParametersFrom (TextureGpu *src) |
void | copyTo (TextureGpu *dst, const TextureBox &dstBox, uint8 dstMipLevel, const TextureBox &srcBox, uint8 srcMipLevel, bool keepResolvedTexSynced=true, CopyEncTransitionMode::CopyEncTransitionMode srcTransitionMode=CopyEncTransitionMode::Auto, CopyEncTransitionMode::CopyEncTransitionMode dstTransitionMode=CopyEncTransitionMode::Auto) override |
virtual ResourceLayout::Layout | getCurrentLayout () const |
void | getCustomAttribute (IdString name, void *pData) override |
ResourceLayout::Layout | getDefaultLayout (bool bIgnoreDiscardableFlag=false) const |
uint32 | getDepth () const |
For TypeCube & TypeCubeArray, this value returns 1. More... | |
uint16 | getDepthBufferPoolId () const override |
uint32 | getDepthOrSlices () const |
PixelFormatGpu | getDesiredDepthBufferFormat () const override |
GLuint | getDisplayTextureName () const |
Returns the GLuid of the texture that is being displayed. More... | |
TextureBox | getEmptyBox (uint8 mipLevel) |
GLuint | getFinalTextureName () const |
Always returns the internal handle that belongs to this texture. More... | |
GLenum | getGlTextureTarget () const |
Returns GL_TEXTURE_2D / GL_TEXTURE_2D_ARRAY / etc. More... | |
GpuPageOutStrategy::GpuPageOutStrategy | getGpuPageOutStrategy () const |
uint32 | getHeight () const |
uint32 | getInternalHeight () const |
Real API height accounting for TextureGpu::getOrientationMode. See getInternalWidth. More... | |
uint32 | getInternalSliceStart () const |
TextureTypes::TextureTypes | getInternalTextureType () const |
uint32 | getInternalWidth () const |
Real API width accounting for TextureGpu::getOrientationMode If orientation mode is 90° or 270° then getInternalWidth returns the height and getInternalHeight returns the width. More... | |
const vector< TextureGpuListener * >::type & | getListeners () const |
GLuint | getMsaaFramebufferName () const |
If MSAA > 1u and TextureFlags::MsaaExplicitResolve is not set, this returns the handle to the temporary MSAA renderbuffer used for rendering, which will later be resolved into the resolve texture. More... | |
IdString | getName () const |
String | getNameStr () const override |
Note: This returns the alias name of the texture. More... | |
GpuResidency::GpuResidency | getNextResidencyStatus () const |
When getResidencyStatus() != getNextResidencyStatus(), residency changes happen in the main thread, while some preparation may be happening in the background. More... | |
uint8 | getNumMipmaps () const |
uint32 | getNumSlices () const |
For TypeCube this value returns 6. More... | |
OrientationMode | getOrientationMode () const override |
uint32 | getPendingResidencyChanges () const |
Returns the number of pending residency changes. More... | |
PixelFormatGpu | getPixelFormat () const |
bool | getPreferDepthTexture () const override |
virtual String | getRealResourceNameStr () const |
Returns the real name (e.g. disk in file) of the resource. More... | |
SampleDescription | getRequestedSampleDescription () const |
Returns original requested sample description, i.e. the raw input to setSampleDescription. More... | |
GpuResidency::GpuResidency | getResidencyStatus () const |
virtual String | getResourceGroupStr () const |
SampleDescription | getSampleDescription () const |
Returns effective sample description supported by the API. More... | |
String | getSettingsDesc () const |
size_t | getSizeBytes () const |
Returns total size in bytes used in GPU by this texture (not by its pool) including mipmaps. More... | |
uint8 | getSourceType () const |
void | getSubsampleLocations (vector< Vector2 >::type locations) override |
Get the MSAA subsample locations. More... | |
TextureGpuManager * | getTextureManager () const |
const TexturePool * | getTexturePool () const |
uint32 | getTexturePoolId () const |
TextureTypes::TextureTypes | getTextureType () const |
uint32 | getWidth () const |
bool | hasAutomaticBatching () const |
bool | hasAutoMipmapAuto () const |
bool | hasEquivalentParameters (TextureGpu *other) const |
bool | hasMsaaExplicitResolves () const |
bool | isDataReady () const |
True if this texture is fully ready to be used for displaying. More... | |
bool | isDiscardableContent () const |
bool | isManualTexture () const |
bool | isMetadataReady () const |
It is threadsafe to call this function from main thread. More... | |
virtual bool | isMsaaPatternSupported (MsaaPatterns::MsaaPatterns pattern) |
bool | isMultisample () const |
virtual bool | isOpenGLRenderWindow () const |
OpenGL RenderWindows are a bit specific: More... | |
bool | isPoolOwner () const |
bool | isReinterpretable () const |
bool | isRenderToTexture () const |
bool | isRenderWindowSpecific () const |
bool | isTexture () const |
bool | isTextureGpu () const override |
bool | isUav () const |
void | notifyAllListenersTextureChanged (uint32 reason, void *extraData=0) |
void | notifyDataIsReady () override |
Notifies it is safe to use the real data. Everything has been uploaded. More... | |
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... | |
bool | prefersLoadingFromFileAsSRGB () const |
void | removeListener (TextureGpuListener *listener) |
bool | requiresTextureFlipping () const |
void | scheduleReupload (Image2 *image=0, bool autoDeleteImage=true) |
There are times where you want to reload a texture again (e.g. More... | |
void | scheduleTransitionTo (GpuResidency::GpuResidency nextResidency, Image2 *image=0, bool autoDeleteImage=true) |
Same as unsafeScheduleTransitionTo, but first checks if we're already in the residency state we want to go to, or if it has already been scheduled; thus it can be called multiple times. More... | |
void | setNumMipmaps (uint8 numMipmaps) |
void | setOrientationMode (OrientationMode orientationMode) override |
Sets the given orientation. More... | |
void | setPixelFormat (PixelFormatGpu pixelFormat) |
Sets the pixel format. More... | |
void | setResolution (uint32 width, uint32 height, uint32 depthOrSlices=1u) |
void | setSampleDescription (SampleDescription desc) |
void | setTexturePoolId (uint32 poolId) |
2D Texture with automatic batching will be merged with other textures into the same pool as one big 2D Array texture behind the scenes. More... | |
void | setTextureType (TextureTypes::TextureTypes textureType) override |
virtual bool | supportsAsDepthBufferFor (TextureGpu *colourTarget) const |
virtual void | swapBuffers () |
Only valid for TextureGpu classes. More... | |
void | unsafeScheduleTransitionTo (GpuResidency::GpuResidency nextResidency, Image2 *image=0, bool autoDeleteImage=true) |
Schedules an async transition in residency. More... | |
void | waitForData () |
Blocks main thread until data is ready. More... | |
void | waitForMetadata () |
Blocks main thread until metadata is ready. More... | |
void | writeContentsToFile (const String &filename, uint8 minMip, uint8 maxMip, bool automaticResolve=true) |
Writes the current contents of the render target to the named file. More... | |
Static Public Attributes | |
static OrientationMode | msDefaultOrientationMode |
PUBLIC VARIABLE. More... | |
static const IdString | msFinalTextureBuffer |
static const IdString | msMsaaTextureBuffer |
Ogre::GL3PlusTextureGpuRenderTarget::GL3PlusTextureGpuRenderTarget | ( | GpuPageOutStrategy::GpuPageOutStrategy | pageOutStrategy, |
VaoManager * | vaoManager, | ||
IdString | name, | ||
uint32 | textureFlags, | ||
TextureTypes::TextureTypes | initialType, | ||
TextureGpuManager * | textureManager | ||
) |
|
override |
|
inherited |
|
overridevirtualinherited |
Tells the API to let the HW autogenerate mipmaps.
Assumes allowsAutoMipmaps() == true and isRenderToTexture() == true
transitionMode | See CopyEncTransitionMode::CopyEncTransitionMode |
Implements Ogre::TextureGpu.
|
inherited |
|
inherited |
Note: Returns non-zero even if there is no system ram copy.
|
inherited |
Note: Returns non-zero even if there is no system ram copy.
|
overridevirtualinherited |
For internal use.
Do not call directly.
This function is the same isDataReady except it ignores pending residency changes, which is important when TextureGpuManager needs to know this information but the TextureGpu is transitioning (thus mPendingResidencyChanges is in an inconsistent state)
Implements Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuWindow.
|
inherited |
|
inherited |
Do not call directly.
Will change mResidencyStatus from GpuResidency::Resident to GpuResidency::OnSystemRam
|
overridevirtualinherited |
Reimplemented from Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuHeadlessWindow, and Ogre::GL3PlusTextureGpuWindow.
|
inherited |
|
inherited |
Immediately resolves this texture to the resolveTexture argument.
Source must be MSAA texture, destination must be non-MSAA.
|
overridevirtual |
These 3 values are used as defaults for the compositor to use, but they may be explicitly overriden by a RenderPassDescriptor.
Particularly required when passing the textures between nodes as input and output (since only the TextureGpu pointer is passed, and thus this information is lost)
depthBufferPoolId | Sets the pool ID this RenderTarget should query from. Default value is POOL_DEFAULT. Set to POOL_NO_DEPTH to avoid using a DepthBuffer (or manually controlling it) |
preferDepthTexture | Whether this RT should be attached to a depth texture, or a regular depth buffer. On older GPUs, preferring depth textures may result in certain depth precisions to not be available (or use integer precision instead of floating point, etc). True to use depth textures. False otherwise (default). |
desiredDepthBufferFormat | Ogre will try to honour this request, but if it's not supported, you may get lower precision. All formats will try to fallback to PF_D24_UNORM_S8_UINT if not supported. Must be one of the following: PFG_D24_UNORM_S8_UINT PFG_D16_UNORM PFG_D32_FLOAT PFG_D32_FLOAT_X24_S8_UINT |
Reimplemented from Ogre::TextureGpu.
|
virtualinherited |
Sets the layout the texture should be transitioned to after the next copy operation (once the copy encoder gets closed)
This is specific to Vulkan & D3D12
Reimplemented in Ogre::VulkanTextureGpu.
|
inherited |
|
inherited |
For internal use.
|
inherited |
|
overridevirtualinherited |
Implements Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuWindow.
|
inherited |
Forces downloading data from GPU to CPU, usually because the data on GPU changed and we're in strategy AlwaysKeepSystemRamCopy.
May stall.
|
inherited |
This function may be called manually (if user is manually managing a texture) or automatically (e.g.
loading from file, or automatic batching is enabled) Once you call this function, you're no longer in OnStorage mode; and will transition to either OnSystemRam or Resident depending on whether auto batching is enabled.
Make sure you're done using mSysRamCopy before calling this function, as we may free that pointer (unless autoDeleteSysRamCopyOnResident = false).
If you're calling _transitionTo yourself (i.e. you're not using scheduleTransitionTo) then you'll need to call _setNextResidencyStatus too, so that both getResidencyStatus and getNextResidencyStatus agree.
sysRamCopy | System RAM copy that backs this GPU data. May be null. Must've been allocated with OGRE_MALLOC_SIMD( size, MEMCATEGORY_RESOURCE ); We will deallocate it. MUST respect _getSysRamCopyBytesPerRow & _getSysRamCopyBytesPerImage. If in doubt, use PixelFormatGpuUtils::getSizeBytes with rowAlignment = 4u; |
This param must be nullptr or equal to get_getSysRamCopy when going from Resident to OnSystemRam and strategy is not AlwaysKeepSystemRamCopy; as we will async download the content from the GPU.
autoDeleteSysRamCopy | When true, we free mSysRamCopy as we should. When false, caller is responsible for deleting this pointer else it will leak! |
|
inherited |
|
inherited |
|
inherited |
Writes the current contents of the render target to the memory.
|
inherited |
|
overridevirtualinherited |
dst | |
dstBox | |
dstMipLevel | |
srcBox | |
srcMipLevel | |
keepResolvedTexSynced | When true, if dst is an MSAA texture and is implicitly resolved (i.e. dst->hasMsaaExplicitResolves() == false); the resolved texture is also kept up to date. |
Typically the reason to set this to false is if you plane on rendering more stuff to dst texture and then resolve.
srcTransitionMode | Transition mode for 'this' |
dstTransitionMode | Transition mode for 'dst' |
Reimplemented from Ogre::TextureGpu.
|
virtualinherited |
Reimplemented in Ogre::VulkanTextureGpu.
|
overridevirtualinherited |
Reimplemented from Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuHeadlessWindow, and Ogre::GL3PlusTextureGpuWindow.
|
inherited |
|
inherited |
For TypeCube & TypeCubeArray, this value returns 1.
|
overridevirtual |
Reimplemented from Ogre::TextureGpu.
|
inherited |
|
overridevirtual |
Reimplemented from Ogre::TextureGpu.
|
inlineinherited |
Returns the GLuid of the texture that is being displayed.
While the texture is being loaded (i.e. data is not ready), we will display a dummy white texture. Once notifyDataIsReady, getDisplayTextureName should be the same as getFinalTextureName. In other words, getDisplayTextureName may change its returned value based on the texture's status
|
inherited |
|
inlineinherited |
Always returns the internal handle that belongs to this texture.
Note that for TextureFlags::AutomaticBatching textures, this will be the handle of a 2D Array texture pool.
If the texture has MSAA enabled, this returns the handle to the resolve texture, not the MSAA one.
If TextureFlags::MsaaExplicitResolve is set, it returns the handle to the MSAA texture, since there is no resolve texture.
|
inlineinherited |
Returns GL_TEXTURE_2D / GL_TEXTURE_2D_ARRAY / etc.
|
inherited |
|
inherited |
|
inherited |
Real API height accounting for TextureGpu::getOrientationMode. See getInternalWidth.
|
inherited |
|
inherited |
|
inherited |
Real API width accounting for TextureGpu::getOrientationMode If orientation mode is 90° or 270° then getInternalWidth returns the height and getInternalHeight returns the width.
|
inherited |
|
inlineinherited |
If MSAA > 1u and TextureFlags::MsaaExplicitResolve is not set, this returns the handle to the temporary MSAA renderbuffer used for rendering, which will later be resolved into the resolve texture.
Otherwise it returns null.
|
inherited |
|
overridevirtualinherited |
Note: This returns the alias name of the texture.
See TextureGpuManager::createOrRetrieveTexture
Reimplemented from Ogre::GpuResource.
|
inherited |
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.
|
inherited |
|
inherited |
For TypeCube this value returns 6.
For TypeCubeArray, value returns numSlices * 6u.
|
overridevirtual |
Reimplemented from Ogre::TextureGpu.
|
inherited |
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
|
inherited |
|
overridevirtual |
Reimplemented from Ogre::TextureGpu.
|
virtualinherited |
Returns the real name (e.g. disk in file) of the resource.
|
inherited |
Returns original requested sample description, i.e. the raw input to setSampleDescription.
|
inherited |
|
virtualinherited |
|
inherited |
Returns effective sample description supported by the API.
Note it's only useful after having transitioned to resident.
|
inherited |
|
inherited |
Returns total size in bytes used in GPU by this texture (not by its pool) including mipmaps.
|
inherited |
|
overridevirtualinherited |
Get the MSAA subsample locations.
mSampleDescription.pattern must not be MsaaPatterns::Undefined.
locations | Outputs an array with the locations for each subsample. Values are in range [-1; 1] |
Implements Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuWindow.
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
True if this texture is fully ready to be used for displaying.
IMPORTANT: Always returns true if getResidencyStatus != GpuResidency::Resident and there are no pending residency transitions.
Returns false while there are pending residency status
If this is true, then isMetadataReady is also true. See isMetadataReady.
|
inherited |
|
inherited |
|
inherited |
It is threadsafe to call this function from main thread.
If this returns false, then the following functions are not threadsafe: Setters must not be called, and getters may change from a worker thread: setResolution getWidth, getHeight, getDepth, getDepthOrSlices, getNumSlices set/getPixelFormat set/getNumMipmaps set/getTextureType getTexturePool Note that this function may return true but the worker thread may still be uploading to this texture. Use isDataReady to see if the worker thread is fully done with this texture.
|
virtualinherited |
Reimplemented in Ogre::D3D11TextureGpu.
|
inherited |
|
virtualinherited |
OpenGL RenderWindows are a bit specific:
Reimplemented in Ogre::VulkanTextureGpuWindow, Ogre::GL3PlusTextureGpuHeadlessWindow, and Ogre::GL3PlusTextureGpuWindow.
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
overridevirtualinherited |
Reimplemented from Ogre::GpuTrackedResource.
|
inherited |
|
inherited |
|
overridevirtualinherited |
Notifies it is safe to use the real data. Everything has been uploaded.
Implements Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuWindow.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
placement operator new
|
inlineinherited |
|
inlineinherited |
array operator new, with debug line info
|
inherited |
|
inherited |
|
inherited |
|
inherited |
There are times where you want to reload a texture again (e.g.
file on disk changed, uploading a new Image2, etc) without visual disruption.
e.g. if you were to call:
you'll achieve the same result, however the texture becomes immediately unavailable causing a few frames were all the user sees is a blank texture until it is fully reloaded.
This routine allows for an in-place hot-reload, where the old texture is swapped for the new one once it's done loading.
This is also faster because DescriptorTextureSets don't change
image | See TextureGpu::unsafeScheduleTransitionTo |
autoDeleteImage | Same TextureGpu::unsafeScheduleTransitionTo |
|
inherited |
Same as unsafeScheduleTransitionTo, but first checks if we're already in the residency state we want to go to, or if it has already been scheduled; thus it can be called multiple times.
|
inherited |
|
overridevirtual |
Sets the given orientation.
'this' must be a RenderTexture If Ogre wasn't build with OGRE_CONFIG_ENABLE_VIEWPORT_ORIENTATIONMODE, calls to this function will not stick (i.e. getOrientationMode always returns the same value)
If OrientationMode == OR_DEGREE_90 or OR_DEGREE_270, the internal resolution if flipped. i.e. swap( width, height ). This is important if you need to perform copyTo operations or AsyncTextureTickets
This setting has only been tested with Vulkan and is likely to malfunction with the other APIs if set to anything other than OR_DEGREE_0
Reimplemented from Ogre::TextureGpu.
|
inherited |
Sets the pixel format.
|
inherited |
|
inherited |
|
inherited |
2D Texture with automatic batching will be merged with other textures into the same pool as one big 2D Array texture behind the scenes.
For two textures to be placed in the same pool (assuming it's not full) the following must match: Width, Height, PixelFormat, number of mipmaps, poolID
Pool ID is an arbitrary value with no actual meaning. This is ID allows you to prevent certain textures from being group together. For example, you may want all textures from Level 0 to be grouped together while Level 1 gets grouped together in a different pool
poolId | Arbitrary value. Default value is 0. |
|
overridevirtualinherited |
Reimplemented from Ogre::TextureGpu.
Reimplemented in Ogre::GL3PlusTextureGpuHeadlessWindow, and Ogre::GL3PlusTextureGpuWindow.
|
virtualinherited |
|
inlinevirtualinherited |
Only valid for TextureGpu classes.
TODO: This may be moved to a different class.
Reimplemented in Ogre::VulkanTextureGpuWindow, Ogre::MetalTextureGpuWindow, Ogre::GL3PlusTextureGpuHeadlessWindow, Ogre::GL3PlusTextureGpuWindow, and Ogre::D3D11TextureGpuWindow.
|
inherited |
Schedules an async transition in residency.
If transitioning from OnStorage to Resident, it will read from file (ResourceGroup was set in createTexture) If transitioning from OnSystemRam to Resident, it will read from the pointer it has. Multiple transitions can be stack together.
nextResidency | The residency to change to. |
image | Pointer to image if you want to load the texture from memory instead of loading it from file or a listener. Pointer must be null if this is a manual texture. Pointer must NOT be a stack variable nor be deleted immediately. The actual loading is postponed until the request reaches the worker thread. That means the image pointer is safe to delete once you receive the TextureGpuListener::Reason::ReadyForRendering message. |
autoDeleteImage | Whether we should call "delete image" once we're done using the image. Otherwise you must listen for TextureGpuListener::ReadyForRendering message to know when we're done using the image. |
|
inherited |
Blocks main thread until data is ready.
Afterwards isDataReady should return true. If it doesn't, then there was a problem loading the texture. See isMetadataReady remarks.
Q: What's the penalty for calling this function?
A: We need to wait for the worker thread to finish all previous textures until it processes this one. The manager only has broad resolution so it may be also possible that we even have to wait the worker thread to process a few textures that came after this one too.
Thus the cost can be anywhere from "very little" to "a lot" depending on the order in which other textures have been loaded.
The real cost is that you lose valuable ability to hide loading times. If you must call this function, you can mitigate the problem:
1. All textures you need to wait for, load them *first* together, then call TextureGpuManager::waitForStreamingCompletion (preferred) or this function. Then proceed to load the rest of the textures. 2. If you can't do the above, call this function as late as possible
|
inherited |
Blocks main thread until metadata is ready.
Afterwards isMetadataReady should return true. If it doesn't, then there was a problem loading the texture. See isMetadataReady remarks.
|
inherited |
Writes the current contents of the render target to the named file.
|
staticinherited |
PUBLIC VARIABLE.
This variable can be altered directly.
Changes are reflected immediately for new TextureGpus. Existing TextureGpus won't be affected
|
staticinherited |
|
staticinherited |