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

#include <qssgrhicontext_p.h>

+ Collaboration diagram for QSSGRhiContext:

Public Member Functions

 QSSGRhiContext (QRhi *rhi=nullptr)
 
 ~QSSGRhiContext ()
 
void initialize (QRhi *rhi)
 
QRhirhi () const
 
bool isValid () const
 
void setMainRenderPassDescriptor (QRhiRenderPassDescriptor *rpDesc)
 
QRhiRenderPassDescriptormainRenderPassDescriptor () const
 
void setCommandBuffer (QRhiCommandBuffer *cb)
 
QRhiCommandBuffercommandBuffer () const
 
void setRenderTarget (QRhiRenderTarget *rt)
 
QRhiRenderTargetrenderTarget () const
 
void setMainPassSampleCount (int samples)
 
int mainPassSampleCount () const
 
QRhiShaderResourceBindingssrb (const QSSGRhiShaderResourceBindingList &bindings)
 
void releaseDrawCallData (QSSGRhiDrawCallData &dcd)
 
QRhiGraphicsPipelinepipeline (const QSSGGraphicsPipelineStateKey &key, QRhiRenderPassDescriptor *rpDesc, QRhiShaderResourceBindings *srb)
 
QRhiComputePipelinecomputePipeline (const QSSGComputePipelineStateKey &key, QRhiShaderResourceBindings *srb)
 
QSSGRhiDrawCallDatadrawCallData (const QSSGRhiDrawCallDataKey &key)
 
QRhiSamplersampler (const QSSGRhiSamplerDescription &samplerDescription)
 
void checkAndAdjustForNPoT (QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription)
 
void registerTexture (QRhiTexture *texture)
 
void releaseTexture (QRhiTexture *texture)
 
QSet< QRhiTexture * > registeredTextures () const
 
void registerMesh (QSSGRenderMesh *mesh)
 
void releaseMesh (QSSGRenderMesh *mesh)
 
QSet< QSSGRenderMesh * > registeredMeshes () const
 
QHash< QSSGGraphicsPipelineStateKey, QRhiGraphicsPipeline * > pipelines () const
 
void cleanupDrawCallData (const QSSGRenderModel *model)
 
QRhiTexturedummyTexture (QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub, const QSize &size=QSize(64, 64), const QColor &fillColor=Qt::black)
 
QSSGRhiInstanceBufferDatainstanceBufferData (QSSGRenderInstanceTable *instanceTable)
 
QSSGRhiInstanceBufferDatainstanceBufferData (const QSSGRenderModel *model)
 
QSSGRhiParticleDataparticleData (const QSSGRenderGraphObject *particlesOrModel)
 
QSSGRhiContextStatsstats ()
 
int maxUniformBufferRange () const
 
void releaseCachedResources ()
 

Static Public Member Functions

static QRhiCommandBuffer::BeginPassFlags commonPassFlags ()
 
static bool shaderDebuggingEnabled ()
 
static bool editorMode ()
 

Detailed Description

Definition at line 922 of file qssgrhicontext_p.h.

Constructor & Destructor Documentation

◆ QSSGRhiContext()

QSSGRhiContext::QSSGRhiContext ( QRhi rhi = nullptr)
explicit

Definition at line 852 of file qssgrhicontext.cpp.

References LightProbe, and Q_STATIC_ASSERT.

◆ ~QSSGRhiContext()

QSSGRhiContext::~QSSGRhiContext ( )

Definition at line 860 of file qssgrhicontext.cpp.

References qDeleteAll(), and releaseCachedResources().

+ Here is the call graph for this function:

Member Function Documentation

◆ checkAndAdjustForNPoT()

void QSSGRhiContext::checkAndAdjustForNPoT ( QRhiTexture texture,
QSSGRhiSamplerDescription samplerDescription 
)

Definition at line 1052 of file qssgrhicontext.cpp.

References QRhiSampler::ClampToEdge, QSize::height(), QSSGRhiSamplerDescription::hTiling, QRhi::isFeatureSupported(), QSSGRhiSamplerDescription::mipmap, QRhiSampler::None, QRhi::NPOTTextureRepeat, qNextPowerOfTwo(), qWarning, QSSGRhiSamplerDescription::vTiling, QSize::width(), and QSSGRhiSamplerDescription::zTiling.

Referenced by RenderHelpers::rhiPrepareRenderable(), and QSSGCustomMaterialSystem::rhiPrepareRenderable().

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

◆ cleanupDrawCallData()

void QSSGRhiContext::cleanupDrawCallData ( const QSSGRenderModel model)

Definition at line 1109 of file qssgrhicontext.cpp.

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

+ Here is the call graph for this function:

◆ commandBuffer()

◆ commonPassFlags()

static QRhiCommandBuffer::BeginPassFlags QSSGRhiContext::commonPassFlags ( )
inlinestatic

◆ computePipeline()

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

Definition at line 1009 of file qssgrhicontext.cpp.

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

Referenced by computePipeline().

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

◆ drawCallData()

◆ dummyTexture()

QRhiTexture * QSSGRhiContext::dummyTexture ( QRhiTexture::Flags  flags,
QRhiResourceUpdateBatch rub,
const QSize size = QSize(64, 64),
const QColor fillColor = Qt::black 
)

Definition at line 1125 of file qssgrhicontext.cpp.

References QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QImage::Format_RGBA8888, QHash< Key, T >::insert(), it, QRhi::newTexture(), qWarning, QRhiTexture::RGBA8, and QRhiResourceUpdateBatch::uploadTexture().

Referenced by addOpaqueDepthPrePassBindings(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), and rhiPrepareResourcesForShadowMap().

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

◆ editorMode()

bool QSSGRhiContext::editorMode ( )
static

Definition at line 1151 of file qssgrhicontext.cpp.

References qEnvironmentVariableIntValue().

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

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

◆ initialize()

void QSSGRhiContext::initialize ( QRhi rhi)

Definition at line 910 of file qssgrhicontext.cpp.

References Q_ASSERT, and rhi().

+ Here is the call graph for this function:

◆ instanceBufferData() [1/2]

QSSGRhiInstanceBufferData & QSSGRhiContext::instanceBufferData ( const QSSGRenderModel model)
inline

Definition at line 991 of file qssgrhicontext_p.h.

References model.

◆ instanceBufferData() [2/2]

QSSGRhiInstanceBufferData & QSSGRhiContext::instanceBufferData ( QSSGRenderInstanceTable instanceTable)
inline

Definition at line 986 of file qssgrhicontext_p.h.

Referenced by QSSGSubsetRenderable::prepareInstancing().

+ Here is the caller graph for this function:

◆ isValid()

bool QSSGRhiContext::isValid ( ) const
inline

Definition at line 931 of file qssgrhicontext_p.h.

Referenced by QSSGRenderer::rhiPrepare(), and QQuick3DSceneRenderer::synchronize().

+ Here is the caller graph for this function:

◆ mainPassSampleCount()

int QSSGRhiContext::mainPassSampleCount ( ) const
inline

Definition at line 943 of file qssgrhicontext_p.h.

◆ mainRenderPassDescriptor()

QRhiRenderPassDescriptor * QSSGRhiContext::mainRenderPassDescriptor ( ) const
inline

Definition at line 934 of file qssgrhicontext_p.h.

◆ maxUniformBufferRange()

int QSSGRhiContext::maxUniformBufferRange ( ) const
inline

Definition at line 1003 of file qssgrhicontext_p.h.

References QRhi::MaxUniformBufferRange.

◆ particleData()

QSSGRhiParticleData & QSSGRhiContext::particleData ( const QSSGRenderGraphObject particlesOrModel)
inline

Definition at line 996 of file qssgrhicontext_p.h.

Referenced by QSSGParticleRenderer::prepareParticlesForModel(), releaseCachedResources(), and QSSGParticleRenderer::rhiPrepareRenderable().

+ Here is the caller graph for this function:

◆ pipeline()

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

Definition at line 945 of file qssgrhicontext.cpp.

References QVarLengthArray< T, Prealloc >::cbegin(), QVarLengthArray< T, Prealloc >::cend(), QRhiGraphicsPipeline::CompileShadersWithDebugInfo, QHash< Key, T >::constEnd(), QHash< Key, T >::constFind(), QRhiGraphicsPipeline::create(), QRhiGraphicsPipeline::TargetBlend::enable, i, QHash< Key, T >::insert(), it, QRhiGraphicsPipeline::Lines, QRhiGraphicsPipeline::LineStrip, QRhi::newGraphicsPipeline(), qEnvironmentVariableIntValue(), qWarning, QRhiGraphicsPipeline::setCullMode(), QRhiGraphicsPipeline::setDepthBias(), QRhiGraphicsPipeline::setDepthOp(), QRhiGraphicsPipeline::setDepthTest(), QRhiGraphicsPipeline::setDepthWrite(), QRhiGraphicsPipeline::setFlags(), QRhiGraphicsPipeline::setLineWidth(), 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, and QRhiGraphicsPipeline::UsesStencilRef.

Referenced by QSSGRhiCubeRenderer::recordRenderCube(), QSSGDebugDrawSystem::recordRenderDebugObjects(), QSSGRhiQuadRenderer::recordRenderQuad(), RenderHelpers::rhiPrepareDepthPass(), RenderHelpers::rhiPrepareRenderable(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), and rhiPrepareResourcesForShadowMap().

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

◆ pipelines()

QHash< QSSGGraphicsPipelineStateKey, QRhiGraphicsPipeline * > QSSGRhiContext::pipelines ( ) const
inline

Definition at line 969 of file qssgrhicontext_p.h.

◆ registeredMeshes()

QSet< QSSGRenderMesh * > QSSGRhiContext::registeredMeshes ( ) const
inline

Definition at line 967 of file qssgrhicontext_p.h.

◆ registeredTextures()

QSet< QRhiTexture * > QSSGRhiContext::registeredTextures ( ) const
inline

Definition at line 963 of file qssgrhicontext_p.h.

◆ registerMesh()

void QSSGRhiContext::registerMesh ( QSSGRenderMesh mesh)

Definition at line 1093 of file qssgrhicontext.cpp.

References QSet< T >::insert().

+ Here is the call graph for this function:

◆ registerTexture()

void QSSGRhiContext::registerTexture ( QRhiTexture texture)

Definition at line 1082 of file qssgrhicontext.cpp.

References QSet< T >::insert().

+ Here is the call graph for this function:

◆ releaseCachedResources()

void QSSGRhiContext::releaseCachedResources ( )

Definition at line 868 of file qssgrhicontext.cpp.

References QHash< Key, T >::clear(), particleData(), qDeleteAll(), releaseDrawCallData(), and QSSGRhiParticleData::texture.

Referenced by ~QSSGRhiContext().

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

◆ releaseDrawCallData()

void QSSGRhiContext::releaseDrawCallData ( QSSGRhiDrawCallData dcd)

Definition at line 934 of file qssgrhicontext.cpp.

References QSSGRhiDrawCallData::bindings, QSSGRhiDrawCallData::pipeline, QSSG_CHECK, QSSGRhiDrawCallData::srb, srb(), QHash< Key, T >::take(), and QSSGRhiDrawCallData::ubuf.

Referenced by cleanupDrawCallData(), and releaseCachedResources().

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

◆ releaseMesh()

void QSSGRhiContext::releaseMesh ( QSSGRenderMesh mesh)

Definition at line 1098 of file qssgrhicontext.cpp.

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

+ Here is the call graph for this function:

◆ releaseTexture()

void QSSGRhiContext::releaseTexture ( QRhiTexture texture)

Definition at line 1087 of file qssgrhicontext.cpp.

References QSet< T >::remove().

Referenced by releaseMesh().

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

◆ renderTarget()

QRhiRenderTarget * QSSGRhiContext::renderTarget ( ) const
inline

Definition at line 940 of file qssgrhicontext_p.h.

◆ rhi()

◆ sampler()

◆ setCommandBuffer()

void QSSGRhiContext::setCommandBuffer ( QRhiCommandBuffer cb)
inline

Definition at line 936 of file qssgrhicontext_p.h.

References cb.

Referenced by QQuick3DSceneRenderer::renderToRhiTexture().

+ Here is the caller graph for this function:

◆ setMainPassSampleCount()

void QSSGRhiContext::setMainPassSampleCount ( int  samples)
inline

Definition at line 942 of file qssgrhicontext_p.h.

Referenced by QQuick3DSceneRenderer::renderToRhiTexture().

+ Here is the caller graph for this function:

◆ setMainRenderPassDescriptor()

void QSSGRhiContext::setMainRenderPassDescriptor ( QRhiRenderPassDescriptor rpDesc)
inline

Definition at line 933 of file qssgrhicontext_p.h.

Referenced by QQuick3DSceneRenderer::renderToRhiTexture().

+ Here is the caller graph for this function:

◆ setRenderTarget()

void QSSGRhiContext::setRenderTarget ( QRhiRenderTarget rt)
inline

Definition at line 939 of file qssgrhicontext_p.h.

Referenced by QQuick3DSceneRenderer::renderToRhiTexture().

+ Here is the caller graph for this function:

◆ shaderDebuggingEnabled()

bool QSSGRhiContext::shaderDebuggingEnabled ( )
static

Definition at line 1145 of file qssgrhicontext.cpp.

References qEnvironmentVariableIntValue().

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

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

◆ srb()

◆ stats()

QSSGRhiContextStats & QSSGRhiContext::stats ( )
inline

Definition at line 1001 of file qssgrhicontext_p.h.

Referenced by QQuick3DSceneRenderer::~QQuick3DSceneRenderer().

+ Here is the caller graph for this function:

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