OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::BarrierSolver Class Reference

#include <OgreResourceTransition.h>

Public Member Functions

void assumeTransition (TextureGpu *texture, ResourceLayout::Layout newLayout, ResourceAccess::ResourceAccess access, uint8 stageMask)
 Tell the solver the texture has been transitioned to a different layout, externally. More...
 
void assumeTransitions (ResourceStatusMap &resourceStatus)
 Tell the solver all these resources have been transitioned to a different layout, externally. More...
 
ResourceTransitionArraygetNewResourceTransitionsArrayTmp ()
 Returns a temporary array variable that can be reused to avoid needless reallocations You're not forced to use it, but it will increase performance. More...
 
const ResourceStatusMapgetResourceStatus ()
 
void reset ()
 
void resolveTransition (ResourceTransitionArray &resourceTransitions, GpuTrackedResource *bufferRes, ResourceAccess::ResourceAccess access, uint8 stageMask)
 Same as the other overload, but meant for buffers. More...
 
void resolveTransition (ResourceTransitionArray &resourceTransitions, TextureGpu *texture, ResourceLayout::Layout newLayout, ResourceAccess::ResourceAccess access, uint8 stageMask)
 By specifying how a texture will be used next, this function figures out the necessary barriers that may be required and outputs to resourceTransitions while storing the current state in mResourceStatus so the next calls to resolveTransition know what was the last usage. More...
 
void textureDeleted (TextureGpu *texture)
 Similar to our notifyTextureChanged overload, to delete what is in mResourceStatus. More...
 

Member Function Documentation

◆ assumeTransition()

void Ogre::BarrierSolver::assumeTransition ( TextureGpu texture,
ResourceLayout::Layout  newLayout,
ResourceAccess::ResourceAccess  access,
uint8  stageMask 
)

Tell the solver the texture has been transitioned to a different layout, externally.

Parameters
textureSee resolveTransition().
newLayoutSee resolveTransition().
accessSee resolveTransition().
stageMaskSee resolveTransition().

◆ assumeTransitions()

void Ogre::BarrierSolver::assumeTransitions ( ResourceStatusMap resourceStatus)

Tell the solver all these resources have been transitioned to a different layout, externally.

◆ getNewResourceTransitionsArrayTmp()

ResourceTransitionArray& Ogre::BarrierSolver::getNewResourceTransitionsArrayTmp ( )
inline

Returns a temporary array variable that can be reused to avoid needless reallocations You're not forced to use it, but it will increase performance.

Beware not to have it in use in two places at the same time! Use it as soon as possible

References Ogre::FastArray< T >::clear().

◆ getResourceStatus()

const ResourceStatusMap& Ogre::BarrierSolver::getResourceStatus ( )

◆ reset()

void Ogre::BarrierSolver::reset ( )

◆ resolveTransition() [1/2]

void Ogre::BarrierSolver::resolveTransition ( ResourceTransitionArray resourceTransitions,
GpuTrackedResource bufferRes,
ResourceAccess::ResourceAccess  access,
uint8  stageMask 
)

Same as the other overload, but meant for buffers.

◆ resolveTransition() [2/2]

void Ogre::BarrierSolver::resolveTransition ( ResourceTransitionArray resourceTransitions,
TextureGpu texture,
ResourceLayout::Layout  newLayout,
ResourceAccess::ResourceAccess  access,
uint8  stageMask 
)

By specifying how a texture will be used next, this function figures out the necessary barriers that may be required and outputs to resourceTransitions while storing the current state in mResourceStatus so the next calls to resolveTransition know what was the last usage.

Parameters
resourceTransitions[in/out] Barriers created so far that will be executed as a single sync point. This variable may or may not be modified depending of whether a barrier is needed
textureThe texture you want to use
newLayoutHow the texture will be used next
accessThe kind of access: Read, Write, R/W.
stageMaskBitmask of the shader stages that will be using this texture after this transition. Only useful when transitioning to ResourceLayout::Texture and ResourceLayout::Uav. Must be 0 otherwise.

◆ textureDeleted()

void Ogre::BarrierSolver::textureDeleted ( TextureGpu texture)

Similar to our notifyTextureChanged overload, to delete what is in mResourceStatus.

However:

  • mCopyStateTextures needs a O(N) search. It is rare for us to put textures there so we use texture->addListener() and notifyTextureChanged to get notified when a texture living in mCopyStateTextures needs to be searched and removed
  • mResourceStatus is an std::map, and many textures can end up there so it could be rather inefficient to call addListener / removeListener frequently Just searching in mResourceStatus should be quite fast. Thus TextureGpuManager will call this function for all textures

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