Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QSSGShaderCache Class Reference

#include <qssgrendershadercache_p.h>

+ Collaboration diagram for QSSGShaderCache:

Public Types

enum class  ShaderType { Vertex = 0 , Fragment = 1 }
 
using InitBakerFunc = void (*)(QShaderBaker *baker, QRhi *rhi)
 

Public Member Functions

 QSSGShaderCache (QSSGRhiContext &ctx, const InitBakerFunc initBakeFn=nullptr)
 
 ~QSSGShaderCache ()
 
void releaseCachedResources ()
 
QQsbInMemoryCollectionpersistentShaderBakingCache ()
 
QSSGRhiShaderPipelinePtr tryGetRhiShaderPipeline (const QByteArray &inKey, const QSSGShaderFeatures &inFeatures)
 
QSSGRhiShaderPipelinePtr tryNewPipelineFromPersistentCache (const QByteArray &qsbcKey, const QByteArray &inKey, const QSSGShaderFeatures &inFeatures, QSSGRhiShaderPipeline::StageFlags stageFlags={})
 
QSSGRhiShaderPipelinePtr newPipelineFromPregenerated (const QByteArray &inKey, const QSSGShaderFeatures &inFeatures, QQsbCollection::Entry entry, const QSSGRenderGraphObject &obj, QSSGRhiShaderPipeline::StageFlags stageFlags={})
 
QSSGRhiShaderPipelinePtr compileForRhi (const QByteArray &inKey, const QByteArray &inVert, const QByteArray &inFrag, const QSSGShaderFeatures &inFeatures, QSSGRhiShaderPipeline::StageFlags stageFlags, int viewCount, bool perTargetCompilation)
 
QSSGBuiltInRhiShaderCachegetBuiltInRhiShaders ()
 

Static Public Member Functions

static QByteArray resourceFolder ()
 
static QByteArray shaderCollectionFile ()
 

Friends

class QSSGBuiltInRhiShaderCache
 

Detailed Description

Definition at line 164 of file qssgrendershadercache_p.h.

Member Typedef Documentation

◆ InitBakerFunc

using QSSGShaderCache::InitBakerFunc = void (*)(QShaderBaker *baker, QRhi *rhi)

Definition at line 174 of file qssgrendershadercache_p.h.

Member Enumeration Documentation

◆ ShaderType

enum class QSSGShaderCache::ShaderType
strong
Enumerator
Vertex 
Fragment 

Definition at line 168 of file qssgrendershadercache_p.h.

Constructor & Destructor Documentation

◆ QSSGShaderCache()

QSSGShaderCache::QSSGShaderCache ( QSSGRhiContext & ctx,
const InitBakerFunc initBakeFn = nullptr )

◆ ~QSSGShaderCache()

QSSGShaderCache::~QSSGShaderCache ( )

Definition at line 289 of file qssgrendershadercache.cpp.

References QString::isEmpty(), and QQsbInMemoryCollection::save().

+ Here is the call graph for this function:

Member Function Documentation

◆ compileForRhi()

QSSGRhiShaderPipelinePtr QSSGShaderCache::compileForRhi ( const QByteArray & inKey,
const QByteArray & inVert,
const QByteArray & inFrag,
const QSSGShaderFeatures & inFeatures,
QSSGRhiShaderPipeline::StageFlags stageFlags,
int viewCount,
bool perTargetCompilation )

◆ getBuiltInRhiShaders()

QSSGBuiltInRhiShaderCache & QSSGShaderCache::getBuiltInRhiShaders ( )
inline

Definition at line 227 of file qssgrendershadercache_p.h.

◆ newPipelineFromPregenerated()

QSSGRhiShaderPipelinePtr QSSGShaderCache::newPipelineFromPregenerated ( const QByteArray & inKey,
const QSSGShaderFeatures & inFeatures,
QQsbCollection::Entry entry,
const QSSGRenderGraphObject & obj,
QSSGRhiShaderPipeline::StageFlags stageFlags = {} )

Definition at line 520 of file qssgrendershadercache.cpp.

References cacheKey(), QSSGRhiContextPrivate::editorMode(), QRhiShaderStage::Fragment, QString::fromLatin1(), QHash< Key, T >::insert(), Q_QUICK3D_PROFILE_END_WITH_ID, Q_QUICK3D_PROFILE_START, Q_TRACE_SCOPE, Q_UNUSED, qDebug, qWarning, QQsbIODeviceCollection::Read, resourceFolder(), shaderCollectionFile(), QSSGRhiContextPrivate::shaderDebuggingEnabled(), and QRhiShaderStage::Vertex.

Referenced by QSSGRendererPrivate::generateRhiShaderPipelineImpl().

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

◆ persistentShaderBakingCache()

QQsbInMemoryCollection & QSSGShaderCache::persistentShaderBakingCache ( )
inline

Definition at line 203 of file qssgrendershadercache_p.h.

◆ releaseCachedResources()

void QSSGShaderCache::releaseCachedResources ( )

Definition at line 295 of file qssgrendershadercache.cpp.

References QHash< Key, T >::clear(), and QSSGBuiltInRhiShaderCache::releaseCachedResources().

+ Here is the call graph for this function:

◆ resourceFolder()

QByteArray QSSGShaderCache::resourceFolder ( )
static

Definition at line 364 of file qssgrendershadercache.cpp.

References QByteArrayLiteral.

Referenced by QSSGShaderLibraryManager::loadPregeneratedShaderInfo(), and newPipelineFromPregenerated().

+ Here is the caller graph for this function:

◆ shaderCollectionFile()

QByteArray QSSGShaderCache::shaderCollectionFile ( )
static

Definition at line 369 of file qssgrendershadercache.cpp.

References QByteArrayLiteral.

Referenced by QSSGShaderLibraryManager::loadPregeneratedShaderInfo(), and newPipelineFromPregenerated().

+ Here is the caller graph for this function:

◆ tryGetRhiShaderPipeline()

QSSGRhiShaderPipelinePtr QSSGShaderCache::tryGetRhiShaderPipeline ( const QByteArray & inKey,
const QSSGShaderFeatures & inFeatures )

Definition at line 305 of file qssgrendershadercache.cpp.

References cacheKey(), QHash< Key, T >::cend(), and QHash< Key, T >::constFind().

Referenced by compileForRhi(), and QSSGRendererPrivate::generateRhiShaderPipelineImpl().

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

◆ tryNewPipelineFromPersistentCache()

QSSGRhiShaderPipelinePtr QSSGShaderCache::tryNewPipelineFromPersistentCache ( const QByteArray & qsbcKey,
const QByteArray & inKey,
const QSSGShaderFeatures & inFeatures,
QSSGRhiShaderPipeline::StageFlags stageFlags = {} )

Definition at line 574 of file qssgrendershadercache.cpp.

References cacheKey(), QSSGRhiContextPrivate::editorMode(), QQsbInMemoryCollection::extractEntry(), QRhiShaderStage::Fragment, QHash< Key, T >::insert(), qDebug, QSSGRhiContextPrivate::shaderDebuggingEnabled(), and QRhiShaderStage::Vertex.

Referenced by QSSGRendererPrivate::generateRhiShaderPipelineImpl().

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

Friends And Related Symbol Documentation

◆ QSSGBuiltInRhiShaderCache

friend class QSSGBuiltInRhiShaderCache
friend

Definition at line 176 of file qssgrendershadercache_p.h.


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