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

#include <qssgrhicontext_p.h>

+ Collaboration diagram for QSSGRhiShaderPipeline:

Classes

struct  CommonUniformIndices
 
struct  InstanceLocations
 

Public Types

enum  StageFlag { UsedWithoutIa = 0x01 }
 
enum class  UniformFlag { Mat3 = 0x01 }
 

Public Member Functions

 QSSGRhiShaderPipeline (QSSGRhiContext &context)
 
QSSGRhiContextcontext () const
 
bool isNull () const
 
void addStage (const QRhiShaderStage &stage, StageFlags flags={})
 
const QRhiShaderStagecbeginStages () const
 
const QRhiShaderStagecendStages () const
 
const QRhiShaderStagevertexStage () const
 
const QRhiShaderStagefragmentStage () const
 
int ub0Size () const
 
int ub0LightDataOffset () const
 
int ub0LightDataSize () const
 
const QHash< QSSGRhiInputAssemblerState::InputSemantic, QShaderDescription::InOutVariable > & vertexInputs () const
 
void setUniformValue (char *ubufData, const char *name, const QVariant &value, QSSGRenderShaderDataType type)
 
void setUniform (char *ubufData, const char *name, const void *data, size_t size, int *storeIndex=nullptr, UniformFlags flags={})
 
void setUniformArray (char *ubufData, const char *name, const void *data, size_t itemCount, QSSGRenderShaderDataType type, int *storeIndex=nullptr)
 
int bindingForTexture (const char *name, int hint=-1)
 
void setLightsEnabled (bool enable)
 
bool isLightingEnabled () const
 
void resetShadowMaps ()
 
QSSGRhiShadowMapPropertiesaddShadowMap ()
 
int shadowMapCount () const
 
const QSSGRhiShadowMapPropertiesshadowMapAt (int index) const
 
QSSGRhiShadowMapPropertiesshadowMapAt (int index)
 
void ensureCombinedMainLightsUniformBuffer (QRhiBuffer **ubuf)
 
void ensureUniformBuffer (QRhiBuffer **ubuf)
 
void setLightProbeTexture (QRhiTexture *texture, QSSGRenderTextureCoordOp hTile=QSSGRenderTextureCoordOp::ClampToEdge, QSSGRenderTextureCoordOp vTile=QSSGRenderTextureCoordOp::ClampToEdge)
 
QRhiTexturelightProbeTexture () const
 
QPair< QSSGRenderTextureCoordOp, QSSGRenderTextureCoordOplightProbeTiling () const
 
void setScreenTexture (QRhiTexture *texture)
 
QRhiTexturescreenTexture () const
 
void setDepthTexture (QRhiTexture *texture)
 
QRhiTexturedepthTexture () const
 
void setSsaoTexture (QRhiTexture *texture)
 
QRhiTexturessaoTexture () const
 
void setLightmapTexture (QRhiTexture *texture)
 
QRhiTexturelightmapTexture () const
 
void resetExtraTextures ()
 
void addExtraTexture (const QSSGRhiTexture &t)
 
int extraTextureCount () const
 
const QSSGRhiTextureextraTextureAt (int index) const
 
QSSGRhiTextureextraTextureAt (int index)
 
QSSGShaderLightsUniformDatalightsUniformData ()
 
InstanceLocations instanceBufferLocations () const
 
int offsetOfUniform (const QByteArray &name)
 

Public Attributes

struct QSSGRhiShaderPipeline::CommonUniformIndices commonUniformIndices
 
struct QSSGRhiShaderPipeline::InstanceLocations instanceLocations
 

Detailed Description

Definition at line 201 of file qssgrhicontext_p.h.

Member Enumeration Documentation

◆ StageFlag

Enumerator
UsedWithoutIa 

Definition at line 210 of file qssgrhicontext_p.h.

◆ UniformFlag

Enumerator
Mat3 

Definition at line 308 of file qssgrhicontext_p.h.

Constructor & Destructor Documentation

◆ QSSGRhiShaderPipeline()

QSSGRhiShaderPipeline::QSSGRhiShaderPipeline ( QSSGRhiContext context)
inlineexplicit

Definition at line 205 of file qssgrhicontext_p.h.

Member Function Documentation

◆ addExtraTexture()

void QSSGRhiShaderPipeline::addExtraTexture ( const QSSGRhiTexture t)
inline

Definition at line 355 of file qssgrhicontext_p.h.

◆ addShadowMap()

QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::addShadowMap ( )
inline

Definition at line 322 of file qssgrhicontext_p.h.

◆ addStage()

void QSSGRhiShaderPipeline::addStage ( const QRhiShaderStage stage,
StageFlags  flags = {} 
)

Definition at line 182 of file qssgrhicontext.cpp.

References QVarLengthArray< T, Prealloc >::append(), BindingMapSize, QSSGRhiInputAssemblerState::BinormalSemantic, QSSGRhiShaderPipeline::InstanceLocations::color, QSSGRhiInputAssemblerState::ColorSemantic, QShaderDescription::combinedImageSamplers(), QVariant::constData(), QSSGRhiShaderPipeline::InstanceLocations::data, QShader::description(), QSSGMesh::MeshInternal::getColorAttrName(), QSSGMesh::MeshInternal::getJointAttrName(), QSSGMesh::MeshInternal::getLightmapUVAttrName(), QSSGMesh::MeshInternal::getNormalAttrName(), QSSGMesh::MeshInternal::getPositionAttrName(), QSSGMesh::MeshInternal::getTexBinormalAttrName(), QSSGMesh::MeshInternal::getTexTanAttrName(), QSSGMesh::MeshInternal::getUV0AttrName(), QSSGMesh::MeshInternal::getUV1AttrName(), QSSGMesh::MeshInternal::getWeightAttrName(), QShaderDescription::inputVariables(), instanceLocations, QSSGRhiInputAssemblerState::JointSemantic, QSSGRhiInputAssemblerState::NormalSemantic, QSSGRhiInputAssemblerState::PositionSemantic, qWarning, QSSGRhiContext::rhi(), QRhiShaderStage::shader(), QSSGRhiInputAssemblerState::TangentSemantic, QSSGRhiInputAssemblerState::TexCoord0Semantic, QSSGRhiInputAssemblerState::TexCoord1Semantic, QSSGRhiInputAssemblerState::TexCoordLightmapSemantic, QSSGRhiShaderPipeline::InstanceLocations::transform0, QSSGRhiShaderPipeline::InstanceLocations::transform1, QSSGRhiShaderPipeline::InstanceLocations::transform2, QRhiShaderStage::type(), QRhi::ubufAligned(), QShaderDescription::uniformBlocks(), UsedWithoutIa, var, QRhiShaderStage::Vertex, and QSSGRhiInputAssemblerState::WeightSemantic.

+ Here is the call graph for this function:

◆ bindingForTexture()

int QSSGRhiShaderPipeline::bindingForTexture ( const char *  name,
int  hint = -1 
)

Definition at line 836 of file qssgrhicontext.cpp.

References QHash< Key, T >::cend(), QHash< Key, T >::constFind(), QByteArray::fromRawData(), hint(), and it.

Referenced by addDepthTextureBindings(), addOpaqueDepthPrePassBindings(), QSSGParticleRenderer::prepareParticlesForModel(), and QSSGParticleRenderer::rhiPrepareRenderable().

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

◆ cbeginStages()

const QRhiShaderStage * QSSGRhiShaderPipeline::cbeginStages ( ) const
inline

Definition at line 219 of file qssgrhicontext_p.h.

◆ cendStages()

const QRhiShaderStage * QSSGRhiShaderPipeline::cendStages ( ) const
inline

Definition at line 220 of file qssgrhicontext_p.h.

◆ context()

QSSGRhiContext & QSSGRhiShaderPipeline::context ( ) const
inline

Definition at line 207 of file qssgrhicontext_p.h.

◆ depthTexture()

QRhiTexture * QSSGRhiShaderPipeline::depthTexture ( ) const
inline

Definition at line 346 of file qssgrhicontext_p.h.

Referenced by addDepthTextureBindings().

+ Here is the caller graph for this function:

◆ ensureCombinedMainLightsUniformBuffer()

void QSSGRhiShaderPipeline::ensureCombinedMainLightsUniformBuffer ( QRhiBuffer **  ubuf)

Definition at line 815 of file qssgrhicontext.cpp.

References QRhiBuffer::create(), QRhiBuffer::Dynamic, QRhi::newBuffer(), QSSGRhiContext::rhi(), and QRhiBuffer::UniformBuffer.

+ Here is the call graph for this function:

◆ ensureUniformBuffer()

void QSSGRhiShaderPipeline::ensureUniformBuffer ( QRhiBuffer **  ubuf)

Definition at line 828 of file qssgrhicontext.cpp.

References QRhiBuffer::create(), QRhiBuffer::Dynamic, QRhi::newBuffer(), QSSGRhiContext::rhi(), and QRhiBuffer::UniformBuffer.

Referenced by QSSGParticleRenderer::rhiPrepareRenderable().

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

◆ extraTextureAt() [1/2]

QSSGRhiTexture & QSSGRhiShaderPipeline::extraTextureAt ( int  index)
inline

Definition at line 358 of file qssgrhicontext_p.h.

◆ extraTextureAt() [2/2]

const QSSGRhiTexture & QSSGRhiShaderPipeline::extraTextureAt ( int  index) const
inline

Definition at line 357 of file qssgrhicontext_p.h.

Referenced by addOpaqueDepthPrePassBindings().

+ Here is the caller graph for this function:

◆ extraTextureCount()

int QSSGRhiShaderPipeline::extraTextureCount ( ) const
inline

Definition at line 356 of file qssgrhicontext_p.h.

Referenced by addOpaqueDepthPrePassBindings().

+ Here is the caller graph for this function:

◆ fragmentStage()

const QRhiShaderStage * QSSGRhiShaderPipeline::fragmentStage ( ) const
inline

Definition at line 229 of file qssgrhicontext_p.h.

References QRhiShaderStage::Fragment.

Referenced by addOpaqueDepthPrePassBindings().

+ Here is the caller graph for this function:

◆ instanceBufferLocations()

InstanceLocations QSSGRhiShaderPipeline::instanceBufferLocations ( ) const
inline

Definition at line 361 of file qssgrhicontext_p.h.

◆ isLightingEnabled()

bool QSSGRhiShaderPipeline::isLightingEnabled ( ) const
inline

Definition at line 319 of file qssgrhicontext_p.h.

◆ isNull()

bool QSSGRhiShaderPipeline::isNull ( ) const
inline

Definition at line 208 of file qssgrhicontext_p.h.

◆ lightmapTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightmapTexture ( ) const
inline

Definition at line 352 of file qssgrhicontext_p.h.

◆ lightProbeTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightProbeTexture ( ) const
inline

Definition at line 336 of file qssgrhicontext_p.h.

◆ lightProbeTiling()

QPair< QSSGRenderTextureCoordOp, QSSGRenderTextureCoordOp > QSSGRhiShaderPipeline::lightProbeTiling ( ) const
inline

Definition at line 337 of file qssgrhicontext_p.h.

◆ lightsUniformData()

QSSGShaderLightsUniformData & QSSGRhiShaderPipeline::lightsUniformData ( )
inline

Definition at line 360 of file qssgrhicontext_p.h.

◆ offsetOfUniform()

int QSSGRhiShaderPipeline::offsetOfUniform ( const QByteArray name)

Definition at line 430 of file qssgrhicontext.cpp.

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

+ Here is the call graph for this function:

◆ resetExtraTextures()

void QSSGRhiShaderPipeline::resetExtraTextures ( )
inline

Definition at line 354 of file qssgrhicontext_p.h.

Referenced by QSSGCustomMaterialSystem::shadersForCustomMaterial().

+ Here is the caller graph for this function:

◆ resetShadowMaps()

void QSSGRhiShaderPipeline::resetShadowMaps ( )
inline

Definition at line 321 of file qssgrhicontext_p.h.

◆ screenTexture()

QRhiTexture * QSSGRhiShaderPipeline::screenTexture ( ) const
inline

Definition at line 343 of file qssgrhicontext_p.h.

◆ setDepthTexture()

void QSSGRhiShaderPipeline::setDepthTexture ( QRhiTexture texture)
inline

Definition at line 345 of file qssgrhicontext_p.h.

◆ setLightmapTexture()

void QSSGRhiShaderPipeline::setLightmapTexture ( QRhiTexture texture)
inline

Definition at line 351 of file qssgrhicontext_p.h.

◆ setLightProbeTexture()

void QSSGRhiShaderPipeline::setLightProbeTexture ( QRhiTexture texture,
QSSGRenderTextureCoordOp  hTile = QSSGRenderTextureCoordOp::ClampToEdge,
QSSGRenderTextureCoordOp  vTile = QSSGRenderTextureCoordOp::ClampToEdge 
)
inline

Definition at line 330 of file qssgrhicontext_p.h.

◆ setLightsEnabled()

void QSSGRhiShaderPipeline::setLightsEnabled ( bool  enable)
inline

Definition at line 318 of file qssgrhicontext_p.h.

◆ setScreenTexture()

void QSSGRhiShaderPipeline::setScreenTexture ( QRhiTexture texture)
inline

Definition at line 342 of file qssgrhicontext_p.h.

◆ setSsaoTexture()

void QSSGRhiShaderPipeline::setSsaoTexture ( QRhiTexture texture)
inline

Definition at line 348 of file qssgrhicontext_p.h.

◆ setUniform()

void QSSGRhiShaderPipeline::setUniform ( char *  ubufData,
const char *  name,
const void data,
size_t  size,
int *  storeIndex = nullptr,
UniformFlags  flags = {} 
)

Definition at line 438 of file qssgrhicontext.cpp.

References ba, QHash< Key, T >::cend(), QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QByteArray::fromRawData(), it, Mat3, QSSGRhiShaderUniform::name, QVarLengthArray< T, Prealloc >::push_back(), Q_ASSERT, qWarning, QSet< T >::size(), QByteArray::size(), QVLABaseBase::size(), and QSSGRhiShaderUniform::size.

Referenced by setUniformValue(), and QSSGParticleRenderer::updateUniformsForParticleModel().

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

◆ setUniformArray()

◆ setUniformValue()

void QSSGRhiShaderPipeline::setUniformValue ( char *  ubufData,
const char *  name,
const QVariant value,
QSSGRenderShaderDataType  type 
)

Definition at line 253 of file qssgrhicontext.cpp.

References Boolean, BooleanVec2, BooleanVec3, BooleanVec4, Float, Integer, IntegerVec2, IntegerVec3, IntegerVec4, Mat3, Matrix3x3, Matrix4x4, Point, PointF, Quaternion, qWarning, Rect, RectF, Rgba, setUniform(), Size, SizeF, QVariant::toInt(), UnsignedInteger, UnsignedIntegerVec2, UnsignedIntegerVec3, UnsignedIntegerVec4, QVariant::value(), Vec2, Vec3, and Vec4.

+ Here is the call graph for this function:

◆ shadowMapAt() [1/2]

QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::shadowMapAt ( int  index)
inline

Definition at line 325 of file qssgrhicontext_p.h.

◆ shadowMapAt() [2/2]

const QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::shadowMapAt ( int  index) const
inline

Definition at line 324 of file qssgrhicontext_p.h.

◆ shadowMapCount()

int QSSGRhiShaderPipeline::shadowMapCount ( ) const
inline

Definition at line 323 of file qssgrhicontext_p.h.

◆ ssaoTexture()

QRhiTexture * QSSGRhiShaderPipeline::ssaoTexture ( ) const
inline

Definition at line 349 of file qssgrhicontext_p.h.

Referenced by addDepthTextureBindings().

+ Here is the caller graph for this function:

◆ ub0LightDataOffset()

int QSSGRhiShaderPipeline::ub0LightDataOffset ( ) const
inline

Definition at line 238 of file qssgrhicontext_p.h.

◆ ub0LightDataSize()

int QSSGRhiShaderPipeline::ub0LightDataSize ( ) const
inline

Definition at line 239 of file qssgrhicontext_p.h.

◆ ub0Size()

int QSSGRhiShaderPipeline::ub0Size ( ) const
inline

Definition at line 237 of file qssgrhicontext_p.h.

Referenced by QSSGParticleRenderer::rhiPrepareRenderable().

+ Here is the caller graph for this function:

◆ vertexInputs()

const QHash< QSSGRhiInputAssemblerState::InputSemantic, QShaderDescription::InOutVariable > & QSSGRhiShaderPipeline::vertexInputs ( ) const
inline

Definition at line 244 of file qssgrhicontext_p.h.

◆ vertexStage()

const QRhiShaderStage * QSSGRhiShaderPipeline::vertexStage ( ) const
inline

Definition at line 222 of file qssgrhicontext_p.h.

References QRhiShaderStage::Vertex.

Referenced by addOpaqueDepthPrePassBindings().

+ Here is the caller graph for this function:

Member Data Documentation

◆ commonUniformIndices

struct QSSGRhiShaderPipeline::CommonUniformIndices QSSGRhiShaderPipeline::commonUniformIndices

◆ instanceLocations

struct QSSGRhiShaderPipeline::InstanceLocations QSSGRhiShaderPipeline::instanceLocations

Referenced by addStage().


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