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

#include <qssgrhicontext_p.h>

+ Collaboration diagram for QSSGRhiContextPrivate:

Public Types

using Textures = QSet<QRhiTexture *>
 
using Meshes = QSet<QSSGRenderMesh *>
 

Public Member Functions

void setMainRenderPassDescriptor (QRhiRenderPassDescriptor *rpDesc)
 
void setCommandBuffer (QRhiCommandBuffer *cb)
 
void setRenderTarget (QRhiRenderTarget *rt)
 
void setMainPassSampleCount (int samples)
 
void setMainPassViewCount (int viewCount)
 
void releaseCachedResources ()
 
void registerTexture (QRhiTexture *texture)
 
void releaseTexture (QRhiTexture *texture)
 
void registerMesh (QSSGRenderMesh *mesh)
 
void releaseMesh (QSSGRenderMesh *mesh)
 
QRhiShaderResourceBindingssrb (const QSSGRhiShaderResourceBindingList &bindings)
 
QRhiGraphicsPipelinepipeline (const QSSGRhiGraphicsPipelineState &ps, QRhiRenderPassDescriptor *rpDesc, QRhiShaderResourceBindings *srb)
 
QRhiGraphicsPipelinepipeline (const QSSGGraphicsPipelineStateKey &key, QRhiRenderPassDescriptor *rpDesc, QRhiShaderResourceBindings *srb)
 
QRhiComputePipelinecomputePipeline (const QShader &shader, QRhiShaderResourceBindings *srb)
 
QRhiComputePipelinecomputePipeline (const QSSGComputePipelineStateKey &key, QRhiShaderResourceBindings *srb)
 
QSSGRhiDrawCallDatadrawCallData (const QSSGRhiDrawCallDataKey &key)
 
void releaseDrawCallData (QSSGRhiDrawCallData &dcd)
 
void cleanupDrawCallData (const QSSGRenderModel *model)
 
QSSGRhiInstanceBufferDatainstanceBufferData (QSSGRenderInstanceTable *instanceTable)
 
QSSGRhiInstanceBufferDatainstanceBufferData (const QSSGRenderModel *model)
 
QSSGRhiParticleDataparticleData (const QSSGRenderGraphObject *particlesOrModel)
 

Static Public Member Functions

static QSSGRhiContextPrivateget (QSSGRhiContext *q)
 
static const QSSGRhiContextPrivateget (const QSSGRhiContext *q)
 
static bool shaderDebuggingEnabled ()
 
static bool editorMode ()
 

Public Attributes

QSSGRhiContextq_ptr = nullptr
 
QRhim_rhi = nullptr
 
QRhiRenderPassDescriptorm_mainRpDesc = nullptr
 
QRhiCommandBufferm_cb = nullptr
 
QRhiRenderTargetm_rt = nullptr
 
Textures m_textures
 
Meshes m_meshes
 
int m_mainSamples = 1
 
int m_mainViewCount = 1
 
QVector< QPair< QSSGRhiSamplerDescription, QRhiSampler * > > m_samplers
 
QHash< QSSGRhiDrawCallDataKey, QSSGRhiDrawCallDatam_drawCallData
 
QHash< QSSGRhiShaderResourceBindingList, QRhiShaderResourceBindings * > m_srbCache
 
QHash< QSSGGraphicsPipelineStateKey, QRhiGraphicsPipeline * > m_pipelines
 
QHash< QSSGComputePipelineStateKey, QRhiComputePipeline * > m_computePipelines
 
QHash< QSSGRhiDummyTextureKey, QRhiTexture * > m_dummyTextures
 
QHash< QSSGRenderInstanceTable *, QSSGRhiInstanceBufferDatam_instanceBuffers
 
QHash< const QSSGRenderModel *, QSSGRhiInstanceBufferDatam_instanceBuffersLod
 
QHash< const QSSGRenderGraphObject *, QSSGRhiParticleDatam_particleData
 
QSSGRhiContextStats m_stats
 

Detailed Description

Definition at line 860 of file qssgrhicontext_p.h.

Member Typedef Documentation

◆ Meshes

◆ Textures

Definition at line 871 of file qssgrhicontext_p.h.

Member Function Documentation

◆ cleanupDrawCallData()

void QSSGRhiContextPrivate::cleanupDrawCallData ( const QSSGRenderModel * model)

Definition at line 1348 of file qssgrhicontext.cpp.

References QHash< Key, T >::begin(), QHash< Key, T >::end(), QHash< Key, T >::erase(), it, m_drawCallData, model, and releaseDrawCallData().

+ Here is the call graph for this function:

◆ computePipeline() [1/2]

QRhiComputePipeline * QSSGRhiContextPrivate::computePipeline ( const QShader & shader,
QRhiShaderResourceBindings * srb )

Definition at line 1230 of file qssgrhicontext.cpp.

References computePipeline(), QSSGComputePipelineStateKey::create(), and srb().

Referenced by computePipeline(), and computePipeline().

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

◆ computePipeline() [2/2]

QRhiComputePipeline * QSSGRhiContextPrivate::computePipeline ( const QSSGComputePipelineStateKey & key,
QRhiShaderResourceBindings * srb )

Definition at line 1669 of file qssgrhicontext.cpp.

References QRhiShaderStage::Compute, computePipeline(), QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QRhiComputePipeline::create(), QHash< Key, T >::insert(), it, m_computePipelines, m_rhi, QRhi::newComputePipeline(), qWarning, QRhiComputePipeline::setShaderResourceBindings(), QRhiComputePipeline::setShaderStage(), and srb().

+ Here is the call graph for this function:

◆ drawCallData()

QSSGRhiDrawCallData & QSSGRhiContextPrivate::drawCallData ( const QSSGRhiDrawCallDataKey & key)

Definition at line 1236 of file qssgrhicontext.cpp.

References m_drawCallData.

◆ editorMode()

bool QSSGRhiContextPrivate::editorMode ( )
static

Definition at line 1595 of file qssgrhicontext.cpp.

References qEnvironmentVariableIntValue().

Referenced by QSSGShaderCache::QSSGShaderCache(), QSSGShaderCache::compileForRhi(), QSSGShaderCache::newPipelineFromPregenerated(), and QSSGShaderCache::tryNewPipelineFromPersistentCache().

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

◆ get() [1/2]

static const QSSGRhiContextPrivate * QSSGRhiContextPrivate::get ( const QSSGRhiContext * q)
inlinestatic

Definition at line 875 of file qssgrhicontext_p.h.

◆ get() [2/2]

◆ instanceBufferData() [1/2]

QSSGRhiInstanceBufferData & QSSGRhiContextPrivate::instanceBufferData ( const QSSGRenderModel * model)

Definition at line 1410 of file qssgrhicontext.cpp.

References m_instanceBuffersLod, and model.

◆ instanceBufferData() [2/2]

QSSGRhiInstanceBufferData & QSSGRhiContextPrivate::instanceBufferData ( QSSGRenderInstanceTable * instanceTable)

Definition at line 1405 of file qssgrhicontext.cpp.

References m_instanceBuffers.

◆ particleData()

QSSGRhiParticleData & QSSGRhiContextPrivate::particleData ( const QSSGRenderGraphObject * particlesOrModel)

Definition at line 1415 of file qssgrhicontext.cpp.

References m_particleData.

Referenced by releaseCachedResources().

+ Here is the caller graph for this function:

◆ pipeline() [1/2]

QRhiGraphicsPipeline * QSSGRhiContextPrivate::pipeline ( const QSSGGraphicsPipelineStateKey & key,
QRhiRenderPassDescriptor * rpDesc,
QRhiShaderResourceBindings * srb )

Definition at line 1601 of file qssgrhicontext.cpp.

References QSSGRhiGraphicsPipelineState::BlendEnabled, QRhiGraphicsPipeline::CompileShadersWithDebugInfo, QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QRhiGraphicsPipeline::create(), QSSGRhiGraphicsPipelineState::DepthTestEnabled, QSSGRhiGraphicsPipelineState::DepthWriteEnabled, QRhiGraphicsPipeline::TargetBlend::enable, QSSGRhiInputAssemblerStatePrivate::get(), QSSGRhiGraphicsPipelineStatePrivate::getShaderPipeline(), i, QHash< Key, T >::insert(), it, QRhiGraphicsPipeline::Lines, QRhiGraphicsPipeline::LineStrip, m_pipelines, m_rhi, QRhi::newGraphicsPipeline(), qEnvironmentVariableIntValue(), qWarning, QRhiGraphicsPipeline::setCullMode(), QRhiGraphicsPipeline::setDepthBias(), QRhiGraphicsPipeline::setDepthOp(), QRhiGraphicsPipeline::setDepthTest(), QRhiGraphicsPipeline::setDepthWrite(), QRhiGraphicsPipeline::setFlags(), QRhiGraphicsPipeline::setLineWidth(), QRhiGraphicsPipeline::setMultiViewCount(), QRhiGraphicsPipeline::setPolygonMode(), QRhiGraphicsPipeline::setRenderPassDescriptor(), QRhiGraphicsPipeline::setSampleCount(), QRhiGraphicsPipeline::setShaderResourceBindings(), QRhiGraphicsPipeline::setShaderStages(), QRhiGraphicsPipeline::setSlopeScaledDepthBias(), QRhiGraphicsPipeline::setStencilFront(), QRhiGraphicsPipeline::setStencilTest(), QRhiGraphicsPipeline::setStencilWriteMask(), QRhiGraphicsPipeline::setTargetBlends(), QRhiGraphicsPipeline::setTopology(), QRhiGraphicsPipeline::setVertexInputLayout(), srb(), QRhiGraphicsPipeline::UsesScissor, QSSGRhiGraphicsPipelineState::UsesScissor, QRhiGraphicsPipeline::UsesStencilRef, and QSSGRhiGraphicsPipelineState::UsesStencilRef.

+ Here is the call graph for this function:

◆ pipeline() [2/2]

QRhiGraphicsPipeline * QSSGRhiContextPrivate::pipeline ( const QSSGRhiGraphicsPipelineState & ps,
QRhiRenderPassDescriptor * rpDesc,
QRhiShaderResourceBindings * srb )

Definition at line 1223 of file qssgrhicontext.cpp.

References QSSGGraphicsPipelineStateKey::create(), pipeline(), and srb().

Referenced by pipeline().

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

◆ registerMesh()

void QSSGRhiContextPrivate::registerMesh ( QSSGRenderMesh * mesh)

Definition at line 1331 of file qssgrhicontext.cpp.

References QSet< T >::insert(), and m_meshes.

+ Here is the call graph for this function:

◆ registerTexture()

void QSSGRhiContextPrivate::registerTexture ( QRhiTexture * texture)

Definition at line 1320 of file qssgrhicontext.cpp.

References QSet< T >::insert(), and m_textures.

+ Here is the call graph for this function:

◆ releaseCachedResources()

void QSSGRhiContextPrivate::releaseCachedResources ( )

Definition at line 1145 of file qssgrhicontext.cpp.

References QHash< Key, T >::clear(), m_computePipelines, m_drawCallData, m_dummyTextures, m_instanceBuffers, m_instanceBuffersLod, m_particleData, m_pipelines, m_samplers, m_srbCache, particleData(), qDeleteAll(), and QSSGRhiParticleData::texture.

+ Here is the call graph for this function:

◆ releaseDrawCallData()

void QSSGRhiContextPrivate::releaseDrawCallData ( QSSGRhiDrawCallData & dcd)

Definition at line 1212 of file qssgrhicontext.cpp.

References m_srbCache, QSSG_CHECK, srb(), and QHash< Key, T >::take().

Referenced by cleanupDrawCallData().

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

◆ releaseMesh()

void QSSGRhiContextPrivate::releaseMesh ( QSSGRenderMesh * mesh)

Definition at line 1336 of file qssgrhicontext.cpp.

References m_meshes, releaseTexture(), QSet< T >::remove(), and QSSGRenderMesh::subsets.

+ Here is the call graph for this function:

◆ releaseTexture()

void QSSGRhiContextPrivate::releaseTexture ( QRhiTexture * texture)

Definition at line 1325 of file qssgrhicontext.cpp.

References m_textures, and QSet< T >::remove().

Referenced by releaseMesh().

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

◆ setCommandBuffer()

void QSSGRhiContextPrivate::setCommandBuffer ( QRhiCommandBuffer * cb)

Definition at line 1081 of file qssgrhicontext.cpp.

References cb, and m_cb.

◆ setMainPassSampleCount()

void QSSGRhiContextPrivate::setMainPassSampleCount ( int samples)

Definition at line 1116 of file qssgrhicontext.cpp.

References m_mainSamples.

◆ setMainPassViewCount()

void QSSGRhiContextPrivate::setMainPassViewCount ( int viewCount)

Definition at line 1130 of file qssgrhicontext.cpp.

References m_mainViewCount.

◆ setMainRenderPassDescriptor()

void QSSGRhiContextPrivate::setMainRenderPassDescriptor ( QRhiRenderPassDescriptor * rpDesc)

Definition at line 1066 of file qssgrhicontext.cpp.

References m_mainRpDesc.

◆ setRenderTarget()

void QSSGRhiContextPrivate::setRenderTarget ( QRhiRenderTarget * rt)

Definition at line 1095 of file qssgrhicontext.cpp.

References m_rt.

◆ shaderDebuggingEnabled()

QT_END_NAMESPACE bool QSSGRhiContextPrivate::shaderDebuggingEnabled ( )
static

Definition at line 1589 of file qssgrhicontext.cpp.

References qEnvironmentVariableIntValue().

Referenced by QSSGShaderCache::QSSGShaderCache(), QSSGShaderCache::compileForRhi(), QSSGShaderCache::newPipelineFromPregenerated(), QSSGShaderCustomMaterialAdapter::prepareCustomShader(), and QSSGShaderCache::tryNewPipelineFromPersistentCache().

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

◆ srb()

QRhiShaderResourceBindings * QSSGRhiContextPrivate::srb ( const QSSGRhiShaderResourceBindingList & bindings)

Definition at line 1194 of file qssgrhicontext.cpp.

References QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QRhiShaderResourceBindings::create(), QHash< Key, T >::insert(), it, m_rhi, m_srbCache, QRhi::newShaderResourceBindings(), QSSGRhiShaderResourceBindingList::p, qWarning, QRhiShaderResourceBindings::setBindings(), srb(), and QSSGRhiShaderResourceBindingList::v.

Referenced by computePipeline(), computePipeline(), pipeline(), pipeline(), releaseDrawCallData(), and srb().

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

Member Data Documentation

◆ m_cb

QRhiCommandBuffer* QSSGRhiContextPrivate::m_cb = nullptr

Definition at line 924 of file qssgrhicontext_p.h.

Referenced by setCommandBuffer().

◆ m_computePipelines

QHash<QSSGComputePipelineStateKey, QRhiComputePipeline *> QSSGRhiContextPrivate::m_computePipelines

Definition at line 936 of file qssgrhicontext_p.h.

Referenced by computePipeline(), and releaseCachedResources().

◆ m_drawCallData

QHash<QSSGRhiDrawCallDataKey, QSSGRhiDrawCallData> QSSGRhiContextPrivate::m_drawCallData

Definition at line 933 of file qssgrhicontext_p.h.

Referenced by cleanupDrawCallData(), drawCallData(), and releaseCachedResources().

◆ m_dummyTextures

QHash<QSSGRhiDummyTextureKey, QRhiTexture *> QSSGRhiContextPrivate::m_dummyTextures

Definition at line 937 of file qssgrhicontext_p.h.

Referenced by releaseCachedResources().

◆ m_instanceBuffers

QHash<QSSGRenderInstanceTable *, QSSGRhiInstanceBufferData> QSSGRhiContextPrivate::m_instanceBuffers

Definition at line 938 of file qssgrhicontext_p.h.

Referenced by instanceBufferData(), and releaseCachedResources().

◆ m_instanceBuffersLod

QHash<const QSSGRenderModel *, QSSGRhiInstanceBufferData> QSSGRhiContextPrivate::m_instanceBuffersLod

Definition at line 939 of file qssgrhicontext_p.h.

Referenced by instanceBufferData(), and releaseCachedResources().

◆ m_mainRpDesc

QRhiRenderPassDescriptor* QSSGRhiContextPrivate::m_mainRpDesc = nullptr

Definition at line 923 of file qssgrhicontext_p.h.

Referenced by setMainRenderPassDescriptor().

◆ m_mainSamples

int QSSGRhiContextPrivate::m_mainSamples = 1

Definition at line 928 of file qssgrhicontext_p.h.

Referenced by setMainPassSampleCount().

◆ m_mainViewCount

int QSSGRhiContextPrivate::m_mainViewCount = 1

Definition at line 929 of file qssgrhicontext_p.h.

Referenced by setMainPassViewCount().

◆ m_meshes

Meshes QSSGRhiContextPrivate::m_meshes

Definition at line 927 of file qssgrhicontext_p.h.

Referenced by registerMesh(), and releaseMesh().

◆ m_particleData

QHash<const QSSGRenderGraphObject *, QSSGRhiParticleData> QSSGRhiContextPrivate::m_particleData

Definition at line 940 of file qssgrhicontext_p.h.

Referenced by particleData(), and releaseCachedResources().

◆ m_pipelines

QHash<QSSGGraphicsPipelineStateKey, QRhiGraphicsPipeline *> QSSGRhiContextPrivate::m_pipelines

Definition at line 935 of file qssgrhicontext_p.h.

Referenced by pipeline(), and releaseCachedResources().

◆ m_rhi

QRhi* QSSGRhiContextPrivate::m_rhi = nullptr

Definition at line 921 of file qssgrhicontext_p.h.

Referenced by computePipeline(), pipeline(), and srb().

◆ m_rt

QRhiRenderTarget* QSSGRhiContextPrivate::m_rt = nullptr

Definition at line 925 of file qssgrhicontext_p.h.

Referenced by setRenderTarget().

◆ m_samplers

QVector<QPair<QSSGRhiSamplerDescription, QRhiSampler*> > QSSGRhiContextPrivate::m_samplers

Definition at line 931 of file qssgrhicontext_p.h.

Referenced by releaseCachedResources().

◆ m_srbCache

QHash<QSSGRhiShaderResourceBindingList, QRhiShaderResourceBindings *> QSSGRhiContextPrivate::m_srbCache

Definition at line 934 of file qssgrhicontext_p.h.

Referenced by releaseCachedResources(), releaseDrawCallData(), and srb().

◆ m_stats

QSSGRhiContextStats QSSGRhiContextPrivate::m_stats

Definition at line 941 of file qssgrhicontext_p.h.

◆ m_textures

Textures QSSGRhiContextPrivate::m_textures

Definition at line 926 of file qssgrhicontext_p.h.

Referenced by registerTexture(), and releaseTexture().

◆ q_ptr

QSSGRhiContext* QSSGRhiContextPrivate::q_ptr = nullptr

Definition at line 920 of file qssgrhicontext_p.h.


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