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
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
 
int ub0ShadowDataOffset () const
 
int ub0ShadowDataSize () const
 
const QHash< QSSGRhiInputAssemblerState::InputSemantic, QShaderDescription::InOutVariable > & vertexInputs () const
 
void setUniformValue (char *ubufData, const char *name, const QVariant &value, QSSGRenderShaderValue::Type 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, QSSGRenderShaderValue::Type 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 ensureCombinedUniformBuffer (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 ()
 
QSSGShaderShadowsUniformDatashadowsUniformData ()
 
InstanceLocations instanceBufferLocations () const
 
int offsetOfUniform (const QByteArray &name)
 

Public Attributes

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

Detailed Description

Definition at line 338 of file qssgrhicontext_p.h.

Member Enumeration Documentation

◆ StageFlag

Enumerator
UsedWithoutIa 

Definition at line 347 of file qssgrhicontext_p.h.

◆ UniformFlag

Enumerator
Mat3 

Definition at line 452 of file qssgrhicontext_p.h.

Constructor & Destructor Documentation

◆ QSSGRhiShaderPipeline()

QSSGRhiShaderPipeline::QSSGRhiShaderPipeline ( QSSGRhiContext & context)
inlineexplicit

Definition at line 342 of file qssgrhicontext_p.h.

Member Function Documentation

◆ addExtraTexture()

void QSSGRhiShaderPipeline::addExtraTexture ( const QSSGRhiTexture & t)
inline

Definition at line 499 of file qssgrhicontext_p.h.

◆ addShadowMap()

QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::addShadowMap ( )
inline

Definition at line 466 of file qssgrhicontext_p.h.

◆ addStage()

◆ bindingForTexture()

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

Definition at line 1017 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 356 of file qssgrhicontext_p.h.

◆ cendStages()

const QRhiShaderStage * QSSGRhiShaderPipeline::cendStages ( ) const
inline

Definition at line 357 of file qssgrhicontext_p.h.

◆ context()

QSSGRhiContext & QSSGRhiShaderPipeline::context ( ) const
inline

Definition at line 344 of file qssgrhicontext_p.h.

◆ depthTexture()

QRhiTexture * QSSGRhiShaderPipeline::depthTexture ( ) const
inline

Definition at line 490 of file qssgrhicontext_p.h.

Referenced by addDepthTextureBindings().

+ Here is the caller graph for this function:

◆ ensureCombinedUniformBuffer()

void QSSGRhiShaderPipeline::ensureCombinedUniformBuffer ( QRhiBuffer ** ubuf)

Definition at line 994 of file qssgrhicontext.cpp.

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

+ Here is the call graph for this function:

◆ ensureUniformBuffer()

void QSSGRhiShaderPipeline::ensureUniformBuffer ( QRhiBuffer ** ubuf)

Definition at line 1009 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 502 of file qssgrhicontext_p.h.

◆ extraTextureAt() [2/2]

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

Definition at line 501 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 500 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 366 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 506 of file qssgrhicontext_p.h.

◆ isLightingEnabled()

bool QSSGRhiShaderPipeline::isLightingEnabled ( ) const
inline

Definition at line 463 of file qssgrhicontext_p.h.

◆ isNull()

bool QSSGRhiShaderPipeline::isNull ( ) const
inline

Definition at line 345 of file qssgrhicontext_p.h.

◆ lightmapTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightmapTexture ( ) const
inline

Definition at line 496 of file qssgrhicontext_p.h.

◆ lightProbeTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightProbeTexture ( ) const
inline

Definition at line 480 of file qssgrhicontext_p.h.

◆ lightProbeTiling()

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

Definition at line 481 of file qssgrhicontext_p.h.

◆ lightsUniformData()

QSSGShaderLightsUniformData & QSSGRhiShaderPipeline::lightsUniformData ( )
inline

Definition at line 504 of file qssgrhicontext_p.h.

◆ offsetOfUniform()

int QSSGRhiShaderPipeline::offsetOfUniform ( const QByteArray & name)

Definition at line 633 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 498 of file qssgrhicontext_p.h.

◆ resetShadowMaps()

void QSSGRhiShaderPipeline::resetShadowMaps ( )
inline

Definition at line 465 of file qssgrhicontext_p.h.

◆ screenTexture()

QRhiTexture * QSSGRhiShaderPipeline::screenTexture ( ) const
inline

Definition at line 487 of file qssgrhicontext_p.h.

◆ setDepthTexture()

void QSSGRhiShaderPipeline::setDepthTexture ( QRhiTexture * texture)
inline

Definition at line 489 of file qssgrhicontext_p.h.

◆ setLightmapTexture()

void QSSGRhiShaderPipeline::setLightmapTexture ( QRhiTexture * texture)
inline

Definition at line 495 of file qssgrhicontext_p.h.

◆ setLightProbeTexture()

Definition at line 474 of file qssgrhicontext_p.h.

◆ setLightsEnabled()

void QSSGRhiShaderPipeline::setLightsEnabled ( bool enable)
inline

Definition at line 462 of file qssgrhicontext_p.h.

◆ setScreenTexture()

void QSSGRhiShaderPipeline::setScreenTexture ( QRhiTexture * texture)
inline

Definition at line 486 of file qssgrhicontext_p.h.

◆ setSsaoTexture()

void QSSGRhiShaderPipeline::setSsaoTexture ( QRhiTexture * texture)
inline

Definition at line 492 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 646 of file qssgrhicontext.cpp.

References ba, QHash< Key, T >::cend(), QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QByteArray::fromRawData(), getUBMemberSizeWarning(), it, Mat3, QSSGRhiShaderUniform::name, QVarLengthArray< T, Prealloc >::push_back(), Q_ASSERT, qPrintable, QSSG_ASSERT_X, QSSG_DEBUG_COND, 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()

void QSSGRhiShaderPipeline::setUniformArray ( char * ubufData,
const char * name,
const void * data,
size_t itemCount,
QSSGRenderShaderValue::Type type,
int * storeIndex = nullptr )

Definition at line 708 of file qssgrhicontext.cpp.

References ba, QSSGRenderShaderValue::Boolean, QSSGRenderShaderValue::BooleanVec2, QSSGRenderShaderValue::BooleanVec3, QSSGRenderShaderValue::BooleanVec4, QHash< Key, T >::cend(), QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QSSGRenderShaderValue::Float, QByteArray::fromRawData(), getUBMemberSizeWarning(), i, QSSGRenderShaderValue::Integer, QSSGRenderShaderValue::IntegerVec2, QSSGRenderShaderValue::IntegerVec3, QSSGRenderShaderValue::IntegerVec4, it, QVarLengthArray< T, Prealloc >::last(), QSSGRenderShaderValue::Matrix3x3, QSSGRenderShaderValue::Matrix4x4, QSSGRhiShaderUniformArray::name, QSSGRenderShaderValue::Point, QSSGRenderShaderValue::PointF, QVarLengthArray< T, Prealloc >::push_back(), Q_UNUSED, qPrintable, QSSG_ASSERT, QSSG_ASSERT_X, QSSG_DEBUG_COND, QSSGRenderShaderValue::Quaternion, qWarning, QSSGRenderShaderValue::Rect, QSSGRenderShaderValue::RectF, QSSGRenderShaderValue::Rgba, QSet< T >::size(), QByteArray::size(), QLatin1StringView::size(), QVLABaseBase::size(), QSSGRenderShaderValue::Size, QSSGRenderShaderValue::SizeF, QSSGRenderShaderValue::UnsignedInteger, QSSGRenderShaderValue::UnsignedIntegerVec2, QSSGRenderShaderValue::UnsignedIntegerVec3, QSSGRenderShaderValue::UnsignedIntegerVec4, QSSGRenderShaderValue::Vec2, QSSGRenderShaderValue::Vec3, and QSSGRenderShaderValue::Vec4.

+ Here is the call graph for this function:

◆ setUniformValue()

◆ shadowMapAt() [1/2]

QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::shadowMapAt ( int index)
inline

Definition at line 469 of file qssgrhicontext_p.h.

◆ shadowMapAt() [2/2]

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

Definition at line 468 of file qssgrhicontext_p.h.

◆ shadowMapCount()

int QSSGRhiShaderPipeline::shadowMapCount ( ) const
inline

Definition at line 467 of file qssgrhicontext_p.h.

◆ shadowsUniformData()

QSSGShaderShadowsUniformData & QSSGRhiShaderPipeline::shadowsUniformData ( )
inline

Definition at line 505 of file qssgrhicontext_p.h.

◆ ssaoTexture()

QRhiTexture * QSSGRhiShaderPipeline::ssaoTexture ( ) const
inline

Definition at line 493 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 375 of file qssgrhicontext_p.h.

◆ ub0LightDataSize()

int QSSGRhiShaderPipeline::ub0LightDataSize ( ) const
inline

Definition at line 376 of file qssgrhicontext_p.h.

◆ ub0ShadowDataOffset()

int QSSGRhiShaderPipeline::ub0ShadowDataOffset ( ) const

Definition at line 450 of file qssgrhicontext.cpp.

References QSSGRhiContext::rhi(), and QRhi::ubufAligned().

+ Here is the call graph for this function:

◆ ub0ShadowDataSize()

int QSSGRhiShaderPipeline::ub0ShadowDataSize ( ) const
inline

Definition at line 381 of file qssgrhicontext_p.h.

◆ ub0Size()

int QSSGRhiShaderPipeline::ub0Size ( ) const
inline

Definition at line 374 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 386 of file qssgrhicontext_p.h.

◆ vertexStage()

const QRhiShaderStage * QSSGRhiShaderPipeline::vertexStage ( ) const
inline

Definition at line 359 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: