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
QSSGShaderLibraryManager Class Reference

#include <qssgrendershaderlibrarymanager_p.h>

+ Collaboration diagram for QSSGShaderLibraryManager:

Public Types

typedef QHash< QByteArray, QByteArrayTPathDataMap
 
typedef QSet< QStringTPathSet
 

Public Member Functions

 QSSGShaderLibraryManager ()
 
 ~QSSGShaderLibraryManager ()
 
void setShaderSource (const QByteArray &inShaderPathKey, QSSGShaderCache::ShaderType type, const QByteArray &inSource, const QSSGCustomShaderMetaData &meta)
 
void loadPregeneratedShaderInfo ()
 
void resolveIncludeFiles (QByteArray &theReadBuffer, const QByteArray &inMaterialInfoString)
 
QByteArray getIncludeContents (const QByteArray &inShaderPathKey)
 
QByteArray getShaderSource (const QByteArray &inShaderPathKey, QSSGShaderCache::ShaderType type)
 
QSSGCustomShaderMetaData getShaderMetaData (const QByteArray &inShaderPathKey, QSSGShaderCache::ShaderType type)
 
void setShaderCodeLibraryVersion (const QByteArray &version)
 

Static Public Member Functions

static QString getShaderCodeLibraryDirectory ()
 
static bool compare (const QSSGShaderDefaultMaterialKey &key1, const QSSGShaderDefaultMaterialKey &key2)
 

Public Attributes

TPathDataMap m_expandedFiles
 
QHash< QByteArray, QSSGCustomShaderMetaDatam_metadata
 
QByteArray m_vertShader
 
QByteArray m_fragShader
 
QQsbCollection::EntryMap m_preGeneratedShaderEntries
 
QReadWriteLock m_lock
 

Detailed Description

Definition at line 66 of file qssgrendershaderlibrarymanager_p.h.

Member Typedef Documentation

◆ TPathDataMap

◆ TPathSet

Constructor & Destructor Documentation

◆ QSSGShaderLibraryManager()

QSSGShaderLibraryManager::QSSGShaderLibraryManager ( )
explicit

Definition at line 26 of file qssgrendershaderlibrarymanager.cpp.

◆ ~QSSGShaderLibraryManager()

QSSGShaderLibraryManager::~QSSGShaderLibraryManager ( )

Definition at line 28 of file qssgrendershaderlibrarymanager.cpp.

Member Function Documentation

◆ compare()

bool QSSGShaderLibraryManager::compare ( const QSSGShaderDefaultMaterialKey & key1,
const QSSGShaderDefaultMaterialKey & key2 )
static

Definition at line 187 of file qssgrendershaderlibrarymanager.cpp.

References calcLightPoint(), COMPARE_PROP, i, QSSGShaderDefaultMaterialKeyProperties::ImageMapCount, QSSGShaderDefaultMaterialKeyProperties::LightCount, and QSSGShaderDefaultMaterialKeyProperties::SingleChannelImageCount.

+ Here is the call graph for this function:

◆ getIncludeContents()

QByteArray QSSGShaderLibraryManager::getIncludeContents ( const QByteArray & inShaderPathKey)

Definition at line 97 of file qssgrendershaderlibrarymanager.cpp.

References QHash< Key, T >::cend(), QHash< Key, T >::constFind(), QString::fromLocal8Bit(), getShaderCodeLibraryDirectory(), QSSGInputUtil::getStreamForFile(), QHash< Key, T >::insert(), m_expandedFiles, m_lock, Q_ASSERT, QByteArrayLiteral, qCCritical, qPrintable, and resolveIncludeFiles().

Referenced by resolveIncludeFiles().

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

◆ getShaderCodeLibraryDirectory()

QT_BEGIN_NAMESPACE QString QSSGShaderLibraryManager::getShaderCodeLibraryDirectory ( )
static

Definition at line 18 of file qssgrendershaderlibrarymanager.cpp.

References QStringLiteral.

Referenced by getIncludeContents().

+ Here is the caller graph for this function:

◆ getShaderMetaData()

QSSGCustomShaderMetaData QSSGShaderLibraryManager::getShaderMetaData ( const QByteArray & inShaderPathKey,
QSSGShaderCache::ShaderType type )

Definition at line 156 of file qssgrendershaderlibrarymanager.cpp.

References QHash< Key, T >::cend(), QHash< Key, T >::constFind(), it, m_lock, m_metadata, qWarning, and stageKey().

Referenced by QSSGShaderCustomMaterialAdapter::hasCustomShaderFunction().

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

◆ getShaderSource()

QByteArray QSSGShaderLibraryManager::getShaderSource ( const QByteArray & inShaderPathKey,
QSSGShaderCache::ShaderType type )

Definition at line 143 of file qssgrendershaderlibrarymanager.cpp.

References QHash< Key, T >::cend(), QHash< Key, T >::constFind(), it, m_expandedFiles, m_lock, QByteArray(), qWarning, and stageKey().

Referenced by QSSGShaderCustomMaterialAdapter::customShaderSnippet().

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

◆ loadPregeneratedShaderInfo()

void QSSGShaderLibraryManager::loadPregeneratedShaderInfo ( )

Definition at line 169 of file qssgrendershaderlibrarymanager.cpp.

References QFile::exists(), file, QString::fromLatin1(), m_preGeneratedShaderEntries, QQsbIODeviceCollection::Read, QSSGShaderCache::resourceFolder(), and QSSGShaderCache::shaderCollectionFile().

+ Here is the call graph for this function:

◆ resolveIncludeFiles()

void QSSGShaderLibraryManager::resolveIncludeFiles ( QByteArray & theReadBuffer,
const QByteArray & inMaterialInfoString )

Definition at line 66 of file qssgrendershaderlibrarymanager.cpp.

References contents, copyrightHeaderEnd(), copyrightHeaderStart(), getIncludeContents(), includeSearch(), QByteArrayLiteral, and qCCritical.

Referenced by QSSGProgramGenerator::compileGeneratedRhiShader(), and getIncludeContents().

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

◆ setShaderCodeLibraryVersion()

void QSSGShaderLibraryManager::setShaderCodeLibraryVersion ( const QByteArray & version)

◆ setShaderSource()

void QSSGShaderLibraryManager::setShaderSource ( const QByteArray & inShaderPathKey,
QSSGShaderCache::ShaderType type,
const QByteArray & inSource,
const QSSGCustomShaderMetaData & meta )

Definition at line 43 of file qssgrendershaderlibrarymanager.cpp.

References QHash< Key, T >::end(), QHash< Key, T >::find(), QHash< Key, T >::insert(), it, m_expandedFiles, m_lock, m_metadata, and stageKey().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_expandedFiles

TPathDataMap QSSGShaderLibraryManager::m_expandedFiles

◆ m_fragShader

QByteArray QSSGShaderLibraryManager::m_fragShader

Definition at line 76 of file qssgrendershaderlibrarymanager_p.h.

◆ m_lock

QReadWriteLock QSSGShaderLibraryManager::m_lock

◆ m_metadata

QHash<QByteArray, QSSGCustomShaderMetaData> QSSGShaderLibraryManager::m_metadata

Definition at line 74 of file qssgrendershaderlibrarymanager_p.h.

Referenced by getShaderMetaData(), and setShaderSource().

◆ m_preGeneratedShaderEntries

QQsbCollection::EntryMap QSSGShaderLibraryManager::m_preGeneratedShaderEntries

◆ m_vertShader

QByteArray QSSGShaderLibraryManager::m_vertShader

Definition at line 75 of file qssgrendershaderlibrarymanager_p.h.


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