![]() |
Qt 6.x
The Qt SDK
|
#include <qssgrendershadercodegenerator_p.h>
Public Types | |
enum class | ShaderItemType { VertexInput , Input , Output , Uniform } |
typedef QMap< QByteArray, QByteArray > | TStrTableStrMap |
typedef QMap< QByteArray, QPair< quint32, QByteArray > > | TStrTableSizedStrMap |
typedef QPair< QByteArray, QByteArray > | TParamPair |
typedef QPair< QByteArray, TParamPair > | TConstantBufferParamPair |
typedef QVector< TConstantBufferParamPair > | TConstantBufferParamArray |
Definition at line 43 of file qssgrendershadercodegenerator_p.h.
Definition at line 62 of file qssgrendershadercodegenerator_p.h.
Definition at line 61 of file qssgrendershadercodegenerator_p.h.
Definition at line 60 of file qssgrendershadercodegenerator_p.h.
Definition at line 58 of file qssgrendershadercodegenerator_p.h.
Definition at line 57 of file qssgrendershadercodegenerator_p.h.
|
strong |
Enumerator | |
---|---|
VertexInput | |
Input | |
Output | |
Uniform |
Definition at line 45 of file qssgrendershadercodegenerator_p.h.
|
explicit |
Definition at line 46 of file qssgrendershadercodegenerator.cpp.
|
virtualdefault |
|
virtual |
Definition at line 93 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), layout, and m_constantBuffers.
Referenced by QSSGMaterialVertexPipeline::addConstantBuffer().
|
virtual |
Definition at line 98 of file qssgrendershadercodegenerator.cpp.
References m_constantBufferParams, and QList< T >::push_back().
Referenced by QSSGMaterialVertexPipeline::addConstantBufferParam().
|
finalvirtual |
Definition at line 349 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), and m_addedDefinitions.
Referenced by QSSGMaterialVertexPipeline::addDefinition().
|
finalvirtual |
Definition at line 339 of file qssgrendershadercodegenerator.cpp.
References addInclude(), QListSpecialMethodsBase< T >::contains(), m_addedFunctions, and QList< T >::push_back().
Referenced by addTranslucencyIrradiance(), calculatePointLightAttenuation(), generateFragmentShader(), generateImageUVCoordinates(), handleSpecularLight(), and outputSpecularEquation().
|
finalvirtual |
Definition at line 212 of file qssgrendershadercodegenerator.cpp.
References QSet< T >::insert(), and m_includes.
Referenced by addFunction(), QSSGMaterialVertexPipeline::addInclude(), QSSGMaterialVertexPipeline::beginVertexGeneration(), QSSGMaterialVertexPipeline::generateEnvMapReflection(), generateFragmentShader(), generateShadowMapOcclusion(), maybeAddMaterialFresnel(), and outputSpecularEquation().
|
virtual |
Definition at line 69 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), and m_incoming.
Referenced by QSSGMaterialVertexPipeline::addIncoming(), QSSGMaterialVertexPipeline::addInterpolationParameter(), and QSSGMaterialVertexPipeline::beginVertexGeneration().
|
virtual |
Definition at line 74 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), m_outgoing, and Q_ASSERT.
Referenced by QSSGMaterialVertexPipeline::addInterpolationParameter().
|
virtual |
Definition at line 183 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), QList< T >::begin(), QMap< Key, T >::begin(), QList< T >::end(), QMap< Key, T >::end(), iter, and m_finalBuilder.
Referenced by buildShaderSourcePass1().
|
virtual |
Reimplemented in QSSGFragmentShaderGenerator.
Definition at line 155 of file qssgrendershadercodegenerator.cpp.
References addShaderItemMap(), addShaderPass2Marker(), m_incoming, and VertexInput.
Referenced by buildShaderSourcePass1().
void QSSGStageGeneratorBase::addShaderItemMap | ( | ShaderItemType | itemType, |
const TStrTableSizedStrMap & | itemMap | ||
) |
void QSSGStageGeneratorBase::addShaderItemMap | ( | QSSGStageGeneratorBase::ShaderItemType | itemType, |
const TStrTableStrMap & | itemMap, | ||
const QByteArray & | inItemSuffix = QByteArray() |
||
) |
Definition at line 125 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), QMap< Key, T >::begin(), QMap< Key, T >::end(), Input, iter, m_finalBuilder, m_mergeContext, m_stage, Output, Q_ASSERT, QByteArrayLiteral, qWarning, QSSGShaderResourceMergeContext::registerInput(), QSSGShaderResourceMergeContext::registerOutput(), QSSGShaderResourceMergeContext::registerSampler(), QSSGShaderResourceMergeContext::registerUniformMember(), Uniform, Vertex, and VertexInput.
Referenced by addShaderIncomingMap(), QSSGFragmentShaderGenerator::addShaderIncomingMap(), addShaderOutgoingMap(), and addShaderUniformMap().
|
virtual |
Reimplemented in QSSGFragmentShaderGenerator.
Definition at line 175 of file qssgrendershadercodegenerator.cpp.
References addShaderItemMap(), addShaderPass2Marker(), m_outgoing, and Output.
Referenced by buildShaderSourcePass1().
void QSSGStageGeneratorBase::addShaderPass2Marker | ( | QSSGStageGeneratorBase::ShaderItemType | itemType | ) |
Definition at line 119 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), m_finalBuilder, m_mergeContext, QByteArray::number(), Q_ASSERT, and QByteArrayLiteral.
Referenced by addShaderIncomingMap(), QSSGFragmentShaderGenerator::addShaderIncomingMap(), addShaderOutgoingMap(), QSSGFragmentShaderGenerator::addShaderOutgoingMap(), and addShaderUniformMap().
|
virtual |
Definition at line 161 of file qssgrendershadercodegenerator.cpp.
References addShaderItemMap(), addShaderPass2Marker(), QMap< Key, T >::begin(), QMap< Key, T >::end(), iter, m_mergeContext, m_uniformArrays, m_uniforms, QByteArray::number(), QByteArrayLiteral, QSSGShaderResourceMergeContext::registerSampler(), QSSGShaderResourceMergeContext::registerUniformMember(), and Uniform.
Referenced by buildShaderSourcePass1().
|
virtual |
Definition at line 83 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), and m_uniforms.
Referenced by QSSGMaterialVertexPipeline::addUniform(), QSSGMaterialVertexPipeline::beginFragmentGeneration(), QSSGMaterialVertexPipeline::beginVertexGeneration(), QSSGMaterialVertexPipeline::doGenerateWorldNormal(), generateFragmentShader(), generateImageUVCoordinates(), generateImageUVSampler(), generateShadowMapOcclusion(), QSSGMaterialVertexPipeline::generateShadowWorldPosition(), QSSGMaterialVertexPipeline::generateViewVector(), and QSSGMaterialVertexPipeline::generateWorldPosition().
|
virtual |
Definition at line 88 of file qssgrendershadercodegenerator.cpp.
References QMap< Key, T >::insert(), m_uniformArrays, and qMakePair().
Referenced by QSSGMaterialVertexPipeline::addUniformArray(), and QSSGMaterialVertexPipeline::beginVertexGeneration().
|
virtual |
Definition at line 111 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), and m_codeBuilder.
Referenced by QSSGMaterialVertexPipeline::append(), QSSGMaterialVertexPipeline::beginVertexGeneration(), QSSGRhiEffectSystem::buildShaderForEffect(), QSSGMaterialVertexPipeline::doGenerateWorldNormal(), QSSGMaterialVertexPipeline::endFragmentGeneration(), QSSGMaterialVertexPipeline::endVertexGeneration(), QSSGMaterialVertexPipeline::generateDepth(), QSSGMaterialVertexPipeline::generateEnvMapReflection(), generateFragmentShader(), generateMainLightCalculation(), QSSGMaterialVertexPipeline::generateObjectNormal(), QSSGMaterialVertexPipeline::generateShadowWorldPosition(), QSSGMaterialVertexPipeline::generateUVCoords(), QSSGMaterialVertexPipeline::generateVertexColor(), QSSGMaterialVertexPipeline::generateWorldNormal(), and QSSGMaterialVertexPipeline::generateWorldPosition().
|
finalvirtual |
Definition at line 210 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), m_codeBuilder, and m_finalBuilder.
Referenced by buildShaderSourcePass1().
|
virtual |
Definition at line 52 of file qssgrendershadercodegenerator.cpp.
References QByteArray::clear(), QList< T >::clear(), QMap< Key, T >::clear(), QSet< T >::clear(), m_addedDefinitions, m_addedFunctions, m_codeBuilder, m_constantBufferParams, m_constantBuffers, m_enabledStages, m_finalBuilder, m_includes, m_incoming, m_outgoing, m_uniformArrays, and m_uniforms.
Referenced by QSSGProgramGenerator::beginProgram().
void QSSGStageGeneratorBase::buildShaderSourcePass1 | ( | QSSGShaderResourceMergeContext * | mergeContext | ) |
Definition at line 214 of file qssgrendershadercodegenerator.cpp.
References addShaderConstantBufferItemMap(), addShaderIncomingMap(), addShaderOutgoingMap(), addShaderUniformMap(), QByteArray::append(), appendShaderCode(), QList< T >::begin(), QMap< Key, T >::begin(), QSet< T >::begin(), QList< T >::end(), QMap< Key, T >::end(), QSet< T >::end(), iter, m_addedDefinitions, m_constantBufferParams, m_constantBuffers, m_finalBuilder, m_includes, m_mergeContext, and QByteArrayLiteral.
Referenced by QSSGProgramGenerator::compileGeneratedRhiShader().
QByteArray QSSGStageGeneratorBase::buildShaderSourcePass2 | ( | QSSGShaderResourceMergeContext * | mergeContext | ) |
Definition at line 248 of file qssgrendershadercodegenerator.cpp.
References addEndCond(), addStartCond(), QString::asprintf(), QVariant::constData(), QByteArray::indexOf(), Input, iter, m_finalBuilder, QSSGShaderResourceMergeContext::m_inOutVars, QSSGShaderResourceMergeContext::m_samplers, m_stage, QSSGShaderResourceMergeContext::m_uniformMembers, QByteArray::mid(), Output, pos, QByteArrayLiteral, QByteArray::replace(), QByteArray::toInt(), QString::toUtf8(), Uniform, var, Vertex, and VertexInput.
Referenced by QSSGProgramGenerator::compileGeneratedRhiShader().
|
virtual |
Definition at line 105 of file qssgrendershadercodegenerator.cpp.
References QByteArray::append(), and m_codeBuilder.
QSSGShaderGeneratorStage QSSGStageGeneratorBase::stage | ( | ) | const |
Definition at line 117 of file qssgrendershadercodegenerator.cpp.
References m_stage.
Referenced by QSSGMaterialVertexPipeline::stage().
TStrTableStrMap QSSGStageGeneratorBase::m_addedDefinitions |
Definition at line 76 of file qssgrendershadercodegenerator_p.h.
Referenced by addDefinition(), begin(), and buildShaderSourcePass1().
QList<QByteArray> QSSGStageGeneratorBase::m_addedFunctions |
Definition at line 75 of file qssgrendershadercodegenerator_p.h.
Referenced by addFunction(), and begin().
QByteArray QSSGStageGeneratorBase::m_codeBuilder |
Definition at line 71 of file qssgrendershadercodegenerator_p.h.
Referenced by append(), appendShaderCode(), begin(), and operator<<().
TConstantBufferParamArray QSSGStageGeneratorBase::m_constantBufferParams |
Definition at line 70 of file qssgrendershadercodegenerator_p.h.
Referenced by addConstantBufferParam(), begin(), and buildShaderSourcePass1().
TStrTableStrMap QSSGStageGeneratorBase::m_constantBuffers |
Definition at line 69 of file qssgrendershadercodegenerator_p.h.
Referenced by addConstantBuffer(), begin(), and buildShaderSourcePass1().
QSSGShaderGeneratorStageFlags QSSGStageGeneratorBase::m_enabledStages |
Definition at line 74 of file qssgrendershadercodegenerator_p.h.
Referenced by begin().
QByteArray QSSGStageGeneratorBase::m_finalBuilder |
Definition at line 72 of file qssgrendershadercodegenerator_p.h.
Referenced by addShaderConstantBufferItemMap(), addShaderItemMap(), addShaderPass2Marker(), appendShaderCode(), begin(), buildShaderSourcePass1(), buildShaderSourcePass2(), and QSSGProgramGenerator::compileGeneratedRhiShader().
QSet<QByteArray> QSSGStageGeneratorBase::m_includes |
Definition at line 66 of file qssgrendershadercodegenerator_p.h.
Referenced by addInclude(), begin(), and buildShaderSourcePass1().
TStrTableStrMap QSSGStageGeneratorBase::m_incoming |
Definition at line 64 of file qssgrendershadercodegenerator_p.h.
Referenced by addIncoming(), addShaderIncomingMap(), QSSGFragmentShaderGenerator::addShaderIncomingMap(), begin(), and QSSGProgramGenerator::linkStages().
QSSGShaderResourceMergeContext* QSSGStageGeneratorBase::m_mergeContext = nullptr |
Definition at line 77 of file qssgrendershadercodegenerator_p.h.
Referenced by addShaderItemMap(), addShaderPass2Marker(), addShaderUniformMap(), and buildShaderSourcePass1().
TStrTableStrMap* QSSGStageGeneratorBase::m_outgoing |
Definition at line 65 of file qssgrendershadercodegenerator_p.h.
Referenced by addOutgoing(), addShaderOutgoingMap(), begin(), and QSSGProgramGenerator::linkStages().
QSSGShaderGeneratorStage QSSGStageGeneratorBase::m_stage |
Definition at line 73 of file qssgrendershadercodegenerator_p.h.
Referenced by addShaderItemMap(), buildShaderSourcePass2(), and stage().
TStrTableSizedStrMap QSSGStageGeneratorBase::m_uniformArrays |
Definition at line 68 of file qssgrendershadercodegenerator_p.h.
Referenced by addShaderUniformMap(), addUniformArray(), and begin().
TStrTableStrMap QSSGStageGeneratorBase::m_uniforms |
Definition at line 67 of file qssgrendershadercodegenerator_p.h.
Referenced by addShaderUniformMap(), addUniform(), and begin().