Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QSSGBufferManager Class Reference

#include <qssgrenderbuffermanager_p.h>

+ Collaboration diagram for QSSGBufferManager:

Classes

struct  CustomImageCacheKey
 
struct  ImageCacheKey
 
struct  ImageData
 
struct  MemoryStats
 
struct  MeshData
 

Public Types

enum  MipMode { MipModeFollowRenderImage , MipModeEnable , MipModeDisable , MipModeBsdf }
 
enum  LoadRenderImageFlag { LoadWithFlippedY = 0x01 }
 

Public Member Functions

 QSSGBufferManager ()
 
 ~QSSGBufferManager ()
 
void setRenderContextInterface (QSSGRenderContextInterface *ctx)
 
void releaseCachedResources ()
 
QSSGRenderImageTexture loadRenderImage (const QSSGRenderImage *image, MipMode inMipMode=MipModeFollowRenderImage, LoadRenderImageFlags flags=LoadWithFlippedY)
 
QSSGRenderImageTexture loadLightmap (const QSSGRenderModel &model)
 
QSSGRenderImageTexture loadSkinmap (QSSGRenderTextureData *skin)
 
QSSGRenderMeshgetMeshForPicking (const QSSGRenderModel &model) const
 
QSSGBounds3 getModelBounds (const QSSGRenderModel *model) const
 
QSSGRenderMeshloadMesh (const QSSGRenderModel *model)
 
void cleanupUnreferencedBuffers (quint32 frameId, QSSGRenderLayer *layer)
 
void resetUsageCounters (quint32 frameId, QSSGRenderLayer *layer)
 
void releaseGeometry (QSSGRenderGeometry *geometry)
 
void releaseTextureData (const QSSGRenderTextureData *data)
 
void releaseTextureData (const CustomImageCacheKey &key)
 
void commitBufferResourceUpdates ()
 
void processResourceLoader (const QSSGRenderResourceLoader *loader)
 
QSSGMesh::Mesh loadMeshData (const QSSGRenderGeometry *geometry)
 
QMutexmeshUpdateMutex ()
 
void increaseMemoryStat (QRhiTexture *texture)
 
void decreaseMemoryStat (QRhiTexture *texture)
 
void increaseMemoryStat (QSSGRenderMesh *mesh)
 
void decreaseMemoryStat (QSSGRenderMesh *mesh)
 
const QHash< ImageCacheKey, ImageData > & getImageMap () const
 
const QHash< CustomImageCacheKey, ImageData > & getCustomTextureMap () const
 
const QHash< QSGTexture *, ImageData > & getSGImageMap () const
 
const QHash< QSSGRenderPath, MeshData > & getMeshMap () const
 
const QHash< QSSGRenderGeometry *, MeshData > & getCustomMeshMap () const
 

Static Public Member Functions

static QSSGMeshBVHloadMeshBVH (const QSSGRenderPath &inSourcePath)
 
static QSSGMeshBVHloadMeshBVH (QSSGRenderGeometry *geometry)
 
static QSSGMesh::Mesh loadMeshData (const QSSGRenderPath &inSourcePath)
 
static QRhiTexture::Format toRhiFormat (const QSSGRenderTextureFormat format)
 
static void registerMeshData (const QString &assetId, const QVector< QSSGMesh::Mesh > &meshData)
 
static void unregisterMeshData (const QString &assetId)
 
static QString runtimeMeshSourceName (const QString &assetId, qsizetype meshId)
 
static QString primitivePath (const QString &primitive)
 

Detailed Description

Definition at line 76 of file qssgrenderbuffermanager_p.h.

Member Enumeration Documentation

◆ LoadRenderImageFlag

Enumerator
LoadWithFlippedY 

Definition at line 116 of file qssgrenderbuffermanager_p.h.

◆ MipMode

Enumerator
MipModeFollowRenderImage 
MipModeEnable 
MipModeDisable 
MipModeBsdf 

Definition at line 109 of file qssgrenderbuffermanager_p.h.

Constructor & Destructor Documentation

◆ QSSGBufferManager()

QSSGBufferManager::QSSGBufferManager ( )

Definition at line 108 of file qssgrenderbuffermanager.cpp.

◆ ~QSSGBufferManager()

QSSGBufferManager::~QSSGBufferManager ( )

Definition at line 112 of file qssgrenderbuffermanager.cpp.

Member Function Documentation

◆ cleanupUnreferencedBuffers()

void QSSGBufferManager::cleanupUnreferencedBuffers ( quint32  frameId,
QSSGRenderLayer layer 
)

Definition at line 1417 of file qssgrenderbuffermanager.cpp.

References decreaseMemoryStat(), Q_UNUSED, qDebug, and QSSGRenderContextInterface::rhiContext().

+ Here is the call graph for this function:

◆ commitBufferResourceUpdates()

void QSSGBufferManager::commitBufferResourceUpdates ( )

Definition at line 1860 of file qssgrenderbuffermanager.cpp.

References QSSGRenderContextInterface::rhiContext().

Referenced by processResourceLoader().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decreaseMemoryStat() [1/2]

void QSSGBufferManager::decreaseMemoryStat ( QRhiTexture texture)

Definition at line 1958 of file qssgrenderbuffermanager.cpp.

References QSSGBufferManager::MemoryStats::imageDataSize, qMax(), QSSGRenderContextInterface::rhiContext(), and textureMemorySize().

Referenced by cleanupUnreferencedBuffers(), releaseGeometry(), and releaseTextureData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ decreaseMemoryStat() [2/2]

void QSSGBufferManager::decreaseMemoryStat ( QSSGRenderMesh mesh)

Definition at line 1971 of file qssgrenderbuffermanager.cpp.

References bufferMemorySize(), QSSGBufferManager::MemoryStats::meshDataSize, qMax(), QSSGRenderContextInterface::rhiContext(), and QSSGRenderMesh::subsets.

+ Here is the call graph for this function:

◆ getCustomMeshMap()

const QHash< QSSGRenderGeometry *, MeshData > & QSSGBufferManager::getCustomMeshMap ( ) const
inline

Definition at line 176 of file qssgrenderbuffermanager_p.h.

◆ getCustomTextureMap()

const QHash< CustomImageCacheKey, ImageData > & QSSGBufferManager::getCustomTextureMap ( ) const
inline

Definition at line 173 of file qssgrenderbuffermanager_p.h.

◆ getImageMap()

const QHash< ImageCacheKey, ImageData > & QSSGBufferManager::getImageMap ( ) const
inline

Definition at line 172 of file qssgrenderbuffermanager_p.h.

◆ getMeshForPicking()

QSSGRenderMesh * QSSGBufferManager::getMeshForPicking ( const QSSGRenderModel model) const

Definition at line 298 of file qssgrenderbuffermanager.cpp.

References model.

Referenced by QSSGRenderer::intersectRayWithSubsetRenderable().

+ Here is the caller graph for this function:

◆ getMeshMap()

const QHash< QSSGRenderPath, MeshData > & QSSGBufferManager::getMeshMap ( ) const
inline

Definition at line 175 of file qssgrenderbuffermanager_p.h.

◆ getModelBounds()

QSSGBounds3 QSSGBufferManager::getModelBounds ( const QSSGRenderModel model) const

Definition at line 1112 of file qssgrenderbuffermanager.cpp.

References QSSGBounds3::include(), QSSGMesh::Mesh::isValid(), loadMeshData(), model, QSSGRenderMesh::subsets, and QSSGMesh::Mesh::subsets().

Referenced by QSSGRenderNode::getBounds(), and QQuick3DSceneManager::updateBoundingBoxes().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSGImageMap()

const QHash< QSGTexture *, ImageData > & QSSGBufferManager::getSGImageMap ( ) const
inline

Definition at line 174 of file qssgrenderbuffermanager_p.h.

◆ increaseMemoryStat() [1/2]

void QSSGBufferManager::increaseMemoryStat ( QRhiTexture texture)

Definition at line 1952 of file qssgrenderbuffermanager.cpp.

References QSSGBufferManager::MemoryStats::imageDataSize, QSSGRenderContextInterface::rhiContext(), and textureMemorySize().

Referenced by loadLightmap(), and loadRenderImage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ increaseMemoryStat() [2/2]

void QSSGBufferManager::increaseMemoryStat ( QSSGRenderMesh mesh)

Definition at line 1964 of file qssgrenderbuffermanager.cpp.

References bufferMemorySize(), QSSGBufferManager::MemoryStats::meshDataSize, QSSGRenderContextInterface::rhiContext(), and QSSGRenderMesh::subsets.

+ Here is the call graph for this function:

◆ loadLightmap()

◆ loadMesh()

QSSGRenderMesh * QSSGBufferManager::loadMesh ( const QSSGRenderModel model)

Definition at line 1090 of file qssgrenderbuffermanager.cpp.

References QSSGLightmapper::lightmapAssetPathForLoad(), QSSGMeshProcessingOptions::lightmapBaseResolution, QSSGMeshProcessingOptions::meshFileOverride, QSSGLightmapper::MeshWithLightmapUV, model, and QSSGMeshProcessingOptions::wantsLightmapUVs.

+ Here is the call graph for this function:

◆ loadMeshBVH() [1/2]

QSSGMeshBVH * QSSGBufferManager::loadMeshBVH ( const QSSGRenderPath inSourcePath)
static

Definition at line 1684 of file qssgrenderbuffermanager.cpp.

References QSSGMeshBVHBuilder::buildTree(), QSSGMesh::Mesh::isValid(), loadMeshData(), QSSGRenderPath::path(), qCWarning, and qPrintable.

+ Here is the call graph for this function:

◆ loadMeshBVH() [2/2]

◆ loadMeshData() [1/2]

QSSGMesh::Mesh QSSGBufferManager::loadMeshData ( const QSSGRenderGeometry geometry)

Definition at line 1786 of file qssgrenderbuffermanager.cpp.

References error, QSSGMesh::Mesh::fromRuntimeData(), QSSGMesh::Mesh::isValid(), QSSGRenderGeometry::meshData(), qPrintable, and qWarning.

+ Here is the call graph for this function:

◆ loadMeshData() [2/2]

QSSGMesh::Mesh QSSGBufferManager::loadMeshData ( const QSSGRenderPath inSourcePath)
static

Definition at line 1741 of file qssgrenderbuffermanager.cpp.

References device, QChar::fromLatin1(), QSSGInputUtil::getStreamForFile(), QString::isEmpty(), QSSGMesh::Mesh::isValid(), QString::lastIndexOf(), QString::left(), QSSGMesh::Mesh::loadMesh(), QStringView::mid(), QSSGRenderPath::path(), qWarning, splitRuntimeMeshPath(), QString::startsWith(), and QStringView::toUInt().

Referenced by getModelBounds(), and loadMeshBVH().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ loadRenderImage()

◆ loadSkinmap()

QSSGRenderImageTexture QSSGBufferManager::loadSkinmap ( QSSGRenderTextureData skin)

Definition at line 293 of file qssgrenderbuffermanager.cpp.

References MipModeDisable.

◆ meshUpdateMutex()

QMutex * QSSGBufferManager::meshUpdateMutex ( )

Definition at line 1070 of file qssgrenderbuffermanager.cpp.

Referenced by QSSGRenderer::intersectRayWithSubsetRenderable().

+ Here is the caller graph for this function:

◆ primitivePath()

QString QSSGBufferManager::primitivePath ( const QString primitive)
static

Definition at line 1057 of file qssgrenderbuffermanager.cpp.

References file, QString::fromLatin1(), nPrimitives, primitives, primitivesDirectory, and QString::toUtf8().

Referenced by loadModelBlendParticleMesh(), and loadModelShapeMesh().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processResourceLoader()

void QSSGBufferManager::processResourceLoader ( const QSSGRenderResourceLoader loader)

Definition at line 1868 of file qssgrenderbuffermanager.cpp.

References commitBufferResourceUpdates(), loader, and loadRenderImage().

+ Here is the call graph for this function:

◆ registerMeshData()

void QSSGBufferManager::registerMeshData ( const QString assetId,
const QVector< QSSGMesh::Mesh > &  meshData 
)
static

Definition at line 1556 of file qssgrenderbuffermanager.cpp.

References QSet< T >::end(), QSet< T >::find(), QSet< T >::insert(), and it.

Referenced by QSSGRuntimeUtils::createScene().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ releaseCachedResources()

void QSSGBufferManager::releaseCachedResources ( )

Definition at line 123 of file qssgrenderbuffermanager.cpp.

◆ releaseGeometry()

void QSSGBufferManager::releaseGeometry ( QSSGRenderGeometry geometry)

Definition at line 1329 of file qssgrenderbuffermanager.cpp.

References decreaseMemoryStat(), QSSGBufferManager::MemoryStats::meshDataSize, Q_QUICK3D_PROFILE_END_WITH_ID, Q_QUICK3D_PROFILE_START, Q_TRACE_SCOPE, qDebug, and QSSGRenderContextInterface::rhiContext().

+ Here is the call graph for this function:

◆ releaseTextureData() [1/2]

void QSSGBufferManager::releaseTextureData ( const CustomImageCacheKey key)

Definition at line 1358 of file qssgrenderbuffermanager.cpp.

References decreaseMemoryStat(), QSSGBufferManager::MemoryStats::imageDataSize, Q_QUICK3D_PROFILE_END_WITH_ID, Q_QUICK3D_PROFILE_START, Q_TRACE_SCOPE, qDebug, and QSSGRenderContextInterface::rhiContext().

+ Here is the call graph for this function:

◆ releaseTextureData() [2/2]

void QSSGBufferManager::releaseTextureData ( const QSSGRenderTextureData data)

Definition at line 1347 of file qssgrenderbuffermanager.cpp.

References it, keys, and releaseTextureData().

Referenced by releaseTextureData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetUsageCounters()

void QSSGBufferManager::resetUsageCounters ( quint32  frameId,
QSSGRenderLayer layer 
)

Definition at line 1528 of file qssgrenderbuffermanager.cpp.

References imageData.

◆ runtimeMeshSourceName()

QString QSSGBufferManager::runtimeMeshSourceName ( const QString assetId,
qsizetype  meshId 
)
static

Definition at line 62 of file qssgrenderbuffermanager.cpp.

References QString::arg(), QString::fromUtf16(), and QString::number().

Referenced by QSSGRuntimeUtils::applyPropertyValue().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setRenderContextInterface()

void QSSGBufferManager::setRenderContextInterface ( QSSGRenderContextInterface ctx)

Definition at line 118 of file qssgrenderbuffermanager.cpp.

◆ toRhiFormat()

QRhiTexture::Format QSSGBufferManager::toRhiFormat ( const QSSGRenderTextureFormat  format)
static

Definition at line 315 of file qssgrenderbuffermanager.cpp.

References QSSGRenderTextureFormat::Alpha8, QRhiTexture::ASTC_10x10, QRhiTexture::ASTC_10x5, QRhiTexture::ASTC_10x6, QRhiTexture::ASTC_10x8, QRhiTexture::ASTC_12x10, QRhiTexture::ASTC_12x12, QRhiTexture::ASTC_4x4, QRhiTexture::ASTC_5x4, QRhiTexture::ASTC_5x5, QRhiTexture::ASTC_6x5, QRhiTexture::ASTC_6x6, QRhiTexture::ASTC_8x5, QRhiTexture::ASTC_8x6, QRhiTexture::ASTC_8x8, QRhiTexture::BC1, QRhiTexture::BC2, QRhiTexture::BC3, QRhiTexture::ETC2_RGBA8, QSSGRenderTextureFormat::Luminance16, QSSGRenderTextureFormat::Luminance8, QSSGRenderTextureFormat::LuminanceAlpha8, qWarning, QRhiTexture::R16, QSSGRenderTextureFormat::R16, QRhiTexture::R16F, QSSGRenderTextureFormat::R16F, QRhiTexture::R32F, QSSGRenderTextureFormat::R32F, QRhiTexture::R8, QSSGRenderTextureFormat::R8, QRhiTexture::RED_OR_ALPHA8, QSSGRenderTextureFormat::RGB_DXT1, QRhiTexture::RGBA16F, QSSGRenderTextureFormat::RGBA16F, QRhiTexture::RGBA32F, QSSGRenderTextureFormat::RGBA32F, QRhiTexture::RGBA8, QSSGRenderTextureFormat::RGBA8, QSSGRenderTextureFormat::RGBA8_ETC2_EAC, QSSGRenderTextureFormat::RGBA_ASTC_10x10, QSSGRenderTextureFormat::RGBA_ASTC_10x5, QSSGRenderTextureFormat::RGBA_ASTC_10x6, QSSGRenderTextureFormat::RGBA_ASTC_10x8, QSSGRenderTextureFormat::RGBA_ASTC_12x10, QSSGRenderTextureFormat::RGBA_ASTC_12x12, QSSGRenderTextureFormat::RGBA_ASTC_4x4, QSSGRenderTextureFormat::RGBA_ASTC_5x4, QSSGRenderTextureFormat::RGBA_ASTC_5x5, QSSGRenderTextureFormat::RGBA_ASTC_6x5, QSSGRenderTextureFormat::RGBA_ASTC_6x6, QSSGRenderTextureFormat::RGBA_ASTC_8x5, QSSGRenderTextureFormat::RGBA_ASTC_8x6, QSSGRenderTextureFormat::RGBA_ASTC_8x8, QSSGRenderTextureFormat::RGBA_DXT3, QSSGRenderTextureFormat::RGBA_DXT5, QSSGRenderTextureFormat::RGBE8, QSSGRenderTextureFormat::SRGB8A8, and QRhiTexture::UnknownFormat.

Referenced by QQuick3DSceneRenderer::synchronize().

+ Here is the caller graph for this function:

◆ unregisterMeshData()

void QSSGBufferManager::unregisterMeshData ( const QString assetId)
static

Definition at line 1565 of file qssgrenderbuffermanager.cpp.

References QSet< T >::end(), QSet< T >::find(), and it.

+ Here is the call graph for this function:

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