OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::GL3PlusStagingTexture Class Referencefinal

#include <OgreGL3PlusStagingTexture.h>

+ Inheritance diagram for Ogre::GL3PlusStagingTexture:

Public Member Functions

 GL3PlusStagingTexture (VaoManager *vaoManager, PixelFormatGpu formatFamily, size_t size, size_t internalBufferStart, size_t vboPoolIdx, GL3PlusDynamicBuffer *dynamicBuffer)
 
 ~GL3PlusStagingTexture () override
 
GL3PlusDynamicBuffer_getDynamicBuffer ()
 
void _resetDynamicBuffer ()
 
void _unmapBuffer ()
 
void startMapRegion () override
 Must be called from main thread when the StagingBuffer is grabbed. More...
 
void stopMapRegion () override
 Must be called from main thread when the StagingBuffer is released. More...
 
void upload (const TextureBox &srcBox, TextureGpu *dstTexture, uint8 mipLevel, const TextureBox *cpuSrcBox=0, const TextureBox *dstBox=0, bool skipSysRamCopy=false) override
 Uploads a region of data in srcBox (which must have been created with mapRegion) into dstTexture. More...
 
- Public Member Functions inherited from Ogre::StagingTextureBufferImpl
 StagingTextureBufferImpl (VaoManager *vaoManager, PixelFormatGpu formatFamily, size_t size, size_t internalBufferStart, size_t vboPoolIdx)
 
 ~StagingTextureBufferImpl () override
 
size_t _getInternalBufferStart () const
 
size_t _getInternalTotalSizeBytes () const
 
size_t _getSizeBytes () override
 Returns size in bytes. More...
 
size_t getVboPoolIndex ()
 
bool isSmallerThan (const StagingTexture *other) const override
 
bool supportsFormat (uint32 width, uint32 height, uint32 depth, uint32 slices, PixelFormatGpu pixelFormat) const override
 D3D11 has restrictions about which StagingTextures can be uploaded to which textures based on texture families (for example all PFG_RGBA32_* belong to the same family). More...
 
- Public Member Functions inherited from Ogre::StagingTexture
 StagingTexture (VaoManager *vaoManager, PixelFormatGpu formatFamily)
 
virtual ~StagingTexture ()
 
PixelFormatGpu getFormatFamily () const
 Returns the format family it was requested. More...
 
uint32 getLastFrameUsed () const
 
TextureBox mapRegion (uint32 width, uint32 height, uint32 depth, uint32 slices, PixelFormatGpu pixelFormat)
 Can be called from worker thread, but not from multiple threads at the same time, also you can't call anything else either. More...
 
bool uploadWillStall ()
 If it returns true, startMapRegion will stall. More...
 

Constructor & Destructor Documentation

◆ GL3PlusStagingTexture()

Ogre::GL3PlusStagingTexture::GL3PlusStagingTexture ( VaoManager vaoManager,
PixelFormatGpu  formatFamily,
size_t  size,
size_t  internalBufferStart,
size_t  vboPoolIdx,
GL3PlusDynamicBuffer dynamicBuffer 
)

◆ ~GL3PlusStagingTexture()

Ogre::GL3PlusStagingTexture::~GL3PlusStagingTexture ( )
override

Member Function Documentation

◆ _getDynamicBuffer()

GL3PlusDynamicBuffer* Ogre::GL3PlusStagingTexture::_getDynamicBuffer ( )
inline

◆ _resetDynamicBuffer()

void Ogre::GL3PlusStagingTexture::_resetDynamicBuffer ( )
inline

◆ _unmapBuffer()

void Ogre::GL3PlusStagingTexture::_unmapBuffer ( )

◆ startMapRegion()

void Ogre::GL3PlusStagingTexture::startMapRegion ( )
overridevirtual

Must be called from main thread when the StagingBuffer is grabbed.

Remarks
Calling this function if you've already called upload() may stall. Grab another StagingTexture to prevent stall. See uploadWillStall.

Reimplemented from Ogre::StagingTextureBufferImpl.

◆ stopMapRegion()

void Ogre::GL3PlusStagingTexture::stopMapRegion ( )
overridevirtual

Must be called from main thread when the StagingBuffer is released.

Reimplemented from Ogre::StagingTexture.

◆ upload()

void Ogre::GL3PlusStagingTexture::upload ( const TextureBox srcBox,
TextureGpu dstTexture,
uint8  mipLevel,
const TextureBox cpuSrcBox = 0,
const TextureBox dstBox = 0,
bool  skipSysRamCopy = false 
)
overridevirtual

Uploads a region of data in srcBox (which must have been created with mapRegion) into dstTexture.

Parameters
srcBoxThe source data to copy from. Must have been created from mapRegion and must not have been altered (i.e. changed its internal variables) Values inside srcBox such as x, y, z & sliceStart will be ignored.
dstTextureThe destination texture. If dstBox is a null pointer, srcBox must match the texture dimensions exactly (x,y,z = 0; same resolution)
cpuSrcBoxA CPU-based copy that we can copy CPU -> CPU to our System RAM copy. This parameters must be present if skipSysRamCopy is false and the dstTexture strategy is GpuPageOutStrategy::AlwaysKeepSystemRamCopy or it is in OnSystemRam state.
mipLevelDestination mipmap.
dstBoxOptional. Region inside dstTexture to copy to. Must have the same dimensions as srcBox. Values inside dstBox such as bytesPerRow, bytesPerImage & data will be ignored.
skipSysRamCopyWhether to skip the copy to system RAM. Should only be used if the System RAM copy is already up to date, which is often the case when you're transitioning to Resident while loading at the same time. If misused, readbacks will be incorrect as data in CPU won't mirror that of the data in GPU, and possibly other bugs too.

Reimplemented from Ogre::StagingTexture.


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