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
 
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 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 308 of file qssgrhicontext_p.h.

Member Enumeration Documentation

◆ StageFlag

Enumerator
UsedWithoutIa 

Definition at line 317 of file qssgrhicontext_p.h.

◆ UniformFlag

Enumerator
Mat3 

Definition at line 417 of file qssgrhicontext_p.h.

Constructor & Destructor Documentation

◆ QSSGRhiShaderPipeline()

QSSGRhiShaderPipeline::QSSGRhiShaderPipeline ( QSSGRhiContext & context)
inlineexplicit

Definition at line 312 of file qssgrhicontext_p.h.

Member Function Documentation

◆ addExtraTexture()

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

Definition at line 464 of file qssgrhicontext_p.h.

◆ addShadowMap()

QSSGRhiShadowMapProperties & QSSGRhiShaderPipeline::addShadowMap ( )
inline

Definition at line 431 of file qssgrhicontext_p.h.

◆ addStage()

◆ bindingForTexture()

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

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

◆ cendStages()

const QRhiShaderStage * QSSGRhiShaderPipeline::cendStages ( ) const
inline

Definition at line 327 of file qssgrhicontext_p.h.

◆ context()

QSSGRhiContext & QSSGRhiShaderPipeline::context ( ) const
inline

Definition at line 314 of file qssgrhicontext_p.h.

◆ depthTexture()

QRhiTexture * QSSGRhiShaderPipeline::depthTexture ( ) const
inline

Definition at line 455 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 989 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 1002 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 467 of file qssgrhicontext_p.h.

◆ extraTextureAt() [2/2]

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

Definition at line 466 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 465 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 336 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 470 of file qssgrhicontext_p.h.

◆ isLightingEnabled()

bool QSSGRhiShaderPipeline::isLightingEnabled ( ) const
inline

Definition at line 428 of file qssgrhicontext_p.h.

◆ isNull()

bool QSSGRhiShaderPipeline::isNull ( ) const
inline

Definition at line 315 of file qssgrhicontext_p.h.

◆ lightmapTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightmapTexture ( ) const
inline

Definition at line 461 of file qssgrhicontext_p.h.

◆ lightProbeTexture()

QRhiTexture * QSSGRhiShaderPipeline::lightProbeTexture ( ) const
inline

Definition at line 445 of file qssgrhicontext_p.h.

◆ lightProbeTiling()

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

Definition at line 446 of file qssgrhicontext_p.h.

◆ lightsUniformData()

QSSGShaderLightsUniformData & QSSGRhiShaderPipeline::lightsUniformData ( )
inline

Definition at line 469 of file qssgrhicontext_p.h.

◆ offsetOfUniform()

int QSSGRhiShaderPipeline::offsetOfUniform ( const QByteArray & name)

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

◆ resetShadowMaps()

void QSSGRhiShaderPipeline::resetShadowMaps ( )
inline

Definition at line 430 of file qssgrhicontext_p.h.

◆ screenTexture()

QRhiTexture * QSSGRhiShaderPipeline::screenTexture ( ) const
inline

Definition at line 452 of file qssgrhicontext_p.h.

◆ setDepthTexture()

void QSSGRhiShaderPipeline::setDepthTexture ( QRhiTexture * texture)
inline

Definition at line 454 of file qssgrhicontext_p.h.

◆ setLightmapTexture()

void QSSGRhiShaderPipeline::setLightmapTexture ( QRhiTexture * texture)
inline

Definition at line 460 of file qssgrhicontext_p.h.

◆ setLightProbeTexture()

Definition at line 439 of file qssgrhicontext_p.h.

◆ setLightsEnabled()

void QSSGRhiShaderPipeline::setLightsEnabled ( bool enable)
inline

Definition at line 427 of file qssgrhicontext_p.h.

◆ setScreenTexture()

void QSSGRhiShaderPipeline::setScreenTexture ( QRhiTexture * texture)
inline

Definition at line 451 of file qssgrhicontext_p.h.

◆ setSsaoTexture()

void QSSGRhiShaderPipeline::setSsaoTexture ( QRhiTexture * texture)
inline

Definition at line 457 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 641 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 703 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 434 of file qssgrhicontext_p.h.

◆ shadowMapAt() [2/2]

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

Definition at line 433 of file qssgrhicontext_p.h.

◆ shadowMapCount()

int QSSGRhiShaderPipeline::shadowMapCount ( ) const
inline

Definition at line 432 of file qssgrhicontext_p.h.

◆ ssaoTexture()

QRhiTexture * QSSGRhiShaderPipeline::ssaoTexture ( ) const
inline

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

◆ ub0LightDataSize()

int QSSGRhiShaderPipeline::ub0LightDataSize ( ) const
inline

Definition at line 346 of file qssgrhicontext_p.h.

◆ ub0Size()

int QSSGRhiShaderPipeline::ub0Size ( ) const
inline

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

◆ vertexStage()

const QRhiShaderStage * QSSGRhiShaderPipeline::vertexStage ( ) const
inline

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