OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
This implementation can be used by all RenderSystem APIs except D3D11, which is why this implementation is part of OgreMain. More...
#include <OgreStagingTextureBufferImpl.h>
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... | |
PixelFormatGpu | getFormatFamily () const |
Returns the format family it was requested. More... | |
uint32 | getLastFrameUsed () const |
size_t | getVboPoolIndex () |
bool | isSmallerThan (const StagingTexture *other) const override |
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... | |
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... | |
void | startMapRegion () override |
virtual void | stopMapRegion () |
Must be called from main thread when the StagingBuffer is released. 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... | |
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... | |
This implementation can be used by all RenderSystem APIs except D3D11, which is why this implementation is part of OgreMain.
Ogre::StagingTextureBufferImpl::StagingTextureBufferImpl | ( | VaoManager * | vaoManager, |
PixelFormatGpu | formatFamily, | ||
size_t | size, | ||
size_t | internalBufferStart, | ||
size_t | vboPoolIdx | ||
) |
|
override |
|
inline |
|
inline |
|
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)
Implements Ogre::StagingTexture.
|
inlineinherited |
Returns the format family it was requested.
Note that in non-D3D11 RenderSystems, supportsFormat may return true despite a format not being from the same family. This information is mostly useful for keeping memory budgets consistent between different APIs (e.g. on D3D11 two StagingTextures, one that supports RGB8, another for BC1 of 64 MB each; on OpenGL we need to request two textures of 64MB each, and not just one because the first one can fulfill every request)
|
inlineinherited |
|
inline |
|
overridevirtual |
Implements Ogre::StagingTexture.
|
inherited |
Can be called from worker thread, but not from multiple threads at the same time, also you can't call anything else either.
You MUST use TextureBox::atFromOffsettedOrigin rather than TextureBox::at (or account for the offset at some point)
Most APIs will return the value starting at 0 0 0 But D3D11 will NOT.
|
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
|
overridevirtual |
Reimplemented from Ogre::StagingTexture.
Reimplemented in Ogre::VulkanStagingTexture, and Ogre::GL3PlusStagingTexture.
|
virtualinherited |
Must be called from main thread when the StagingBuffer is released.
Reimplemented in Ogre::VulkanStagingTexture, Ogre::MetalStagingTexture, Ogre::GL3PlusStagingTexture, and Ogre::D3D11StagingTexture.
|
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.
|
virtualinherited |
Uploads a region of data in srcBox (which must have been created with mapRegion) into dstTexture.
srcBox | The 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. |
dstTexture | The destination texture. If dstBox is a null pointer, srcBox must match the texture dimensions exactly (x,y,z = 0; same resolution) |
cpuSrcBox | A 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. |
mipLevel | Destination mipmap. |
dstBox | Optional. Region inside dstTexture to copy to. Must have the same dimensions as srcBox. Values inside dstBox such as bytesPerRow, bytesPerImage & data will be ignored. |
skipSysRamCopy | Whether 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 in Ogre::VulkanStagingTexture, Ogre::MetalStagingTexture, Ogre::GL3PlusStagingTexture, and Ogre::D3D11StagingTexture.
|
inherited |
If it returns true, startMapRegion will stall.