OGRE-Next  3.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::StagingTextureBufferImpl Class Referenceabstract

This implementation can be used by all RenderSystem APIs except D3D11, which is why this implementation is part of OgreMain. More...

#include <OgreStagingTextureBufferImpl.h>

+ Inheritance diagram for Ogre::StagingTextureBufferImpl:

Public Member Functions

 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
 
void startMapRegion () override
 Must be called from main thread when the StagingBuffer is grabbed. More...
 
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...
 
virtual void stopMapRegion ()
 Must be called from main thread when the StagingBuffer is released. More...
 
virtual void upload (const TextureBox &srcBox, TextureGpu *dstTexture, uint8 mipLevel, const TextureBox *cpuSrcBox=0, const TextureBox *dstBox=0, bool skipSysRamCopy=false)
 Uploads a region of data in srcBox (which must have been created with mapRegion) into dstTexture. More...
 
bool uploadWillStall ()
 If it returns true, startMapRegion will stall. More...
 

Detailed Description

This implementation can be used by all RenderSystem APIs except D3D11, which is why this implementation is part of OgreMain.

Constructor & Destructor Documentation

◆ StagingTextureBufferImpl()

Ogre::StagingTextureBufferImpl::StagingTextureBufferImpl ( VaoManager vaoManager,
PixelFormatGpu  formatFamily,
size_t  size,
size_t  internalBufferStart,
size_t  vboPoolIdx 
)

◆ ~StagingTextureBufferImpl()

Ogre::StagingTextureBufferImpl::~StagingTextureBufferImpl ( )
override

Member Function Documentation

◆ _getInternalBufferStart()

size_t Ogre::StagingTextureBufferImpl::_getInternalBufferStart ( ) const
inline

◆ _getInternalTotalSizeBytes()

size_t Ogre::StagingTextureBufferImpl::_getInternalTotalSizeBytes ( ) const
inline

◆ _getSizeBytes()

size_t Ogre::StagingTextureBufferImpl::_getSizeBytes ( )
overridevirtual

Returns size in bytes.

Note it's tagged as advanced use (via _underscore) because Just because a StagingTexture has enough available size, does not mean it can hold the data you'll want (a D3D11 StagingTexture of 256x512 cannot hold 1024x1 texture data even though it has the available capacity)

Returns
Size in bytes of this staging texture.

Implements Ogre::StagingTexture.

◆ getVboPoolIndex()

size_t Ogre::StagingTextureBufferImpl::getVboPoolIndex ( )
inline

◆ isSmallerThan()

bool Ogre::StagingTextureBufferImpl::isSmallerThan ( const StagingTexture other) const
overridevirtual

Implements Ogre::StagingTexture.

◆ startMapRegion()

void Ogre::StagingTextureBufferImpl::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::StagingTexture.

Reimplemented in Ogre::VulkanStagingTexture, and Ogre::GL3PlusStagingTexture.

◆ supportsFormat()

bool Ogre::StagingTextureBufferImpl::supportsFormat ( uint32  width,
uint32  height,
uint32  depth,
uint32  slices,
PixelFormatGpu  pixelFormat 
) const
overridevirtual

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).

This function will return true if the StagingTexture can be used with the given format. On all the other RenderSystems, this nonsense does not exist thus it returns always true unless the request is so big it could never be fullfilled (it's larger than our maximum capacity)

Implements Ogre::StagingTexture.

Reimplemented in Ogre::VulkanStagingTexture.


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