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
RenderHelpers Namespace Reference

Functions

std::pair< QSSGBoxPoints, QSSGBoxPointscalculateSortedObjectBounds (const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects)
 
void rhiRenderShadowMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRhiGraphicsPipelineState &ps, QSSGRenderShadowMap &shadowMapManager, const QSSGRenderCamera &camera, const QSSGShaderLightList &globalLights, const QSSGRenderableObjectList &sortedOpaqueObjects, QSSGRenderer &renderer, const QSSGBoxPoints &castingObjectsBox, const QSSGBoxPoints &receivingObjectsBox)
 
void rhiRenderReflectionMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRhiGraphicsPipelineState *ps, QSSGRenderReflectionMap &reflectionMapManager, const QVector< QSSGRenderReflectionProbe * > &reflectionProbes, const QSSGRenderableObjectList &reflectionPassObjects, QSSGRenderer &renderer)
 
bool rhiPrepareDepthPass (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, int samples, int viewCount)
 
void rhiRenderDepthPass (QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, bool *needsSetViewport)
 
bool rhiPrepareAoTexture (QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
 
void rhiRenderAoTexture (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderer &renderer, QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiGraphicsPipelineState &ps, const QSSGAmbientOcclusionSettings &ao, const QSSGRhiRenderableTexture &rhiAoTexture, const QSSGRhiRenderableTexture &rhiDepthTexture, const QSSGRenderCamera &camera)
 
bool rhiPrepareScreenTexture (QSSGRhiContext *rhiCtx, const QSize &size, bool wantsMips, QSSGRhiRenderableTexture *renderableTex)
 
void rhiPrepareGrid (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCameraList &cameras, QSSGRenderer &renderer)
 
void rhiPrepareSkyBox (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCameraList &cameras, QSSGRenderer &renderer)
 
void rhiPrepareSkyBoxForReflectionMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCamera &inCamera, QSSGRenderer &renderer, QSSGReflectionMapEntry *entry, QSSGRenderTextureCubeFace cubeFace)
 
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiPrepareRenderable (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRenderableObject &inObject, QRhiRenderPassDescriptor *renderPassDescriptor, QSSGRhiGraphicsPipelineState *ps, QSSGShaderFeatures featureSet, int samples, int viewCount, QSSGRenderCamera *alteredCamera=nullptr, QMatrix4x4 *alteredModelViewProjection=nullptr, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone, QSSGReflectionMapEntry *entry=nullptr)
 
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiRenderRenderable (QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, QSSGRenderableObject &object, bool *needsSetViewport, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone)
 
bool rhiPrepareDepthTexture (QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
 
QRect correctViewportCoordinates (const QRectF &layerViewport, const QRect &deviceRect)
 

Function Documentation

◆ calculateSortedObjectBounds()

std::pair< QSSGBoxPoints, QSSGBoxPoints > RenderHelpers::calculateSortedObjectBounds ( const QSSGRenderableObjectList & sortedOpaqueObjects,
const QSSGRenderableObjectList & sortedTransparentObjects )

Definition at line 98 of file qssgrenderhelpers.cpp.

◆ correctViewportCoordinates()

QRect RenderHelpers::correctViewportCoordinates ( const QRectF & layerViewport,
const QRect & deviceRect )
inline

Definition at line 131 of file qssgrenderhelpers_p.h.

References QRect::bottom(), and deviceRect.

Referenced by Item2DPass::renderPrep().

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

◆ rhiPrepareAoTexture()

bool RenderHelpers::rhiPrepareAoTexture ( QSSGRhiContext * rhiCtx,
const QSize & size,
QSSGRhiRenderableTexture * renderableTex )

Definition at line 1524 of file qssgrenderhelpers.cpp.

References QSSGRhiContext::mainPassViewCount(), QRhi::newTexture(), QRhi::newTextureArray(), QRhi::newTextureRenderTarget(), QByteArrayLiteral, qWarning, QRhiTexture::RenderTarget, QRhiTexture::RGBA8, QSSGRhiContext::rhi(), QRhiResource::setName(), and QRhiTexture::setPixelSize().

+ Here is the call graph for this function:

◆ rhiPrepareDepthPass()

bool RenderHelpers::rhiPrepareDepthPass ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
const QSSGRhiGraphicsPipelineState & basePipelineState,
QRhiRenderPassDescriptor * rpDesc,
QSSGLayerRenderData & inData,
const QSSGRenderableObjectList & sortedOpaqueObjects,
const QSSGRenderableObjectList & sortedTransparentObjects,
int samples,
int viewCount )

◆ rhiPrepareDepthTexture()

bool RenderHelpers::rhiPrepareDepthTexture ( QSSGRhiContext * rhiCtx,
const QSize & size,
QSSGRhiRenderableTexture * renderableTex )

◆ rhiPrepareGrid()

void RenderHelpers::rhiPrepareGrid ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
QSSGRenderLayer & layer,
QSSGRenderCameraList & cameras,
QSSGRenderer & renderer )

Definition at line 1717 of file qssgrenderhelpers.cpp.

References QSSGRhiShaderResourceBindingList::addUniformBuffer(), cb, QSSGRhiContext::commandBuffer(), QVarLengthArray< T, Prealloc >::count(), QRhiBuffer::create(), QRhiBuffer::Dynamic, QSSGRhiContextPrivate::get(), QMatrix4x4::inverted(), QRhi::isYUpInNDC(), QRhi::newBuffer(), QByteArrayLiteral, renderer, RENDERER_VISIBILITY_ALL, QSSGRhiContext::rhi(), QRhiBuffer::UniformBuffer, and Qt::Uninitialized.

Referenced by InfiniteGridPass::renderPrep().

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

◆ rhiPrepareRenderable()

void RenderHelpers::rhiPrepareRenderable ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
const QSSGLayerRenderData & inData,
QSSGRenderableObject & inObject,
QRhiRenderPassDescriptor * renderPassDescriptor,
QSSGRhiGraphicsPipelineState * ps,
QSSGShaderFeatures featureSet,
int samples,
int viewCount,
QSSGRenderCamera * alteredCamera = nullptr,
QMatrix4x4 * alteredModelViewProjection = nullptr,
QSSGRenderTextureCubeFace cubeFace = QSSGRenderTextureCubeFaceNone,
QSSGReflectionMapEntry * entry = nullptr )

Definition at line 709 of file qssgrenderhelpers.cpp.

References addDepthTextureBindings(), QSSGRhiShaderResourceBindingList::addTexture(), QSSGRhiShaderResourceBindingList::addUniformBuffer(), QSSGRhiHelpers::bakeVertexInputLocations(), QRhiBuffer::beginFullDynamicBufferUpdateForCurrentFrame(), QSSGRhiContext::checkAndAdjustForNPoT(), QRhiSampler::ClampToEdge, QSSGGraphicsPipelineStateKey::create(), QSSGRhiGraphicsPipelineState::cullMode, QSSGShaderFeatures::disableTonemapping(), fillTargetBlend(), QRhiTexture::flags(), QRhiShaderResourceBinding::FragmentStage, QSSGRhiInputAssemblerStatePrivate::get(), QSSGRhiContextPrivate::get(), QSSGMaterialShaderGenerator::getSamplerName(), i, QSSGBaseTypeHelpers::indexOfCubeFace(), QSSGShaderFeatures::isSet(), QSSGShaderFeatures::Lightmap, LightmapTexture, QSSGShaderFeatures::LightProbe, LightProbe, QRhiSampler::Linear, QSSGRenderCustomMaterial::m_iblProbe, QRhiTexture::MipMapped, QRhiSampler::Nearest, QRhiSampler::None, QSSGParticleRenderer::prepareParticlesForModel(), Q_ASSERT, QSSGRenderTextureCubeFaceNone, qWarning, ReceivesReflections, QSSGShaderFeatures::ReflectionProbe, RENDERER_VISIBILITY_ALL, QRhiSampler::Repeat, QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), QSSGRhiContext::sampler(), QSSGRhiGraphicsPipelineState::samples, ScreenTexture, ScreenTextureArray, QSSGShaderFeatures::set(), setupInstancing(), shadersForDefaultMaterial(), shadersForParticleMaterial(), QSSGRhiGraphicsPipelineState::targetBlend, QSSGRhiHelpers::toCullMode(), QSSGRhiHelpers::toRhi(), QSSGRhiDrawCallData::ubuf, updateUniformsForDefaultMaterial(), QSSGParticleRenderer::updateUniformsForParticleModel(), QRhiShaderResourceBinding::VertexStage, and QSSGRhiGraphicsPipelineState::viewCount.

Referenced by OpaquePass::prep(), TransparentPass::prep(), and ScreenReflectionPass::renderPrep().

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

◆ rhiPrepareScreenTexture()

bool RenderHelpers::rhiPrepareScreenTexture ( QSSGRhiContext * rhiCtx,
const QSize & size,
bool wantsMips,
QSSGRhiRenderableTexture * renderableTex )

◆ rhiPrepareSkyBox()

void RenderHelpers::rhiPrepareSkyBox ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
QSSGRenderLayer & layer,
QSSGRenderCameraList & cameras,
QSSGRenderer & renderer )

Definition at line 1878 of file qssgrenderhelpers.cpp.

References cb, QSSGRhiContext::commandBuffer(), QByteArrayLiteral, renderer, and rhiPrepareSkyBox_helper().

Referenced by SkyboxPass::renderPrep(), and SkyboxCubeMapPass::renderPrep().

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

◆ rhiPrepareSkyBoxForReflectionMap()

void RenderHelpers::rhiPrepareSkyBoxForReflectionMap ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
QSSGRenderLayer & layer,
QSSGRenderCamera & inCamera,
QSSGRenderer & renderer,
QSSGReflectionMapEntry * entry,
QSSGRenderTextureCubeFace cubeFace )

Definition at line 1892 of file qssgrenderhelpers.cpp.

References cb, QSSGRhiContext::commandBuffer(), QByteArrayLiteral, renderer, and rhiPrepareSkyBox_helper().

+ Here is the call graph for this function:

◆ rhiRenderAoTexture()

◆ rhiRenderDepthPass()

void RenderHelpers::rhiRenderDepthPass ( QSSGRhiContext * rhiCtx,
const QSSGRhiGraphicsPipelineState & ps,
const QSSGRenderableObjectList & sortedOpaqueObjects,
const QSSGRenderableObjectList & sortedTransparentObjects,
bool * needsSetViewport )

Definition at line 2039 of file qssgrenderhelpers.cpp.

References cb, QSSGRhiContext::commandBuffer(), draw(), Q_QUICK3D_PROFILE_END_WITH_IDS, Q_QUICK3D_PROFILE_START, QSSGRHICTX_STAT, QRhiResource::rhi(), and QSSGRhiGraphicsPipelineState::viewport.

+ Here is the call graph for this function:

◆ rhiRenderReflectionMap()

◆ rhiRenderRenderable()

void RenderHelpers::rhiRenderRenderable ( QSSGRhiContext * rhiCtx,
const QSSGRhiGraphicsPipelineState & state,
QSSGRenderableObject & object,
bool * needsSetViewport,
QSSGRenderTextureCubeFace cubeFace = QSSGRenderTextureCubeFaceNone )

Definition at line 1045 of file qssgrenderhelpers.cpp.

References cb, QSSGRhiContext::commandBuffer(), draw(), QSSGBaseTypeHelpers::indexOfCubeFace(), Q_QUICK3D_PROFILE_END_WITH_IDS, Q_QUICK3D_PROFILE_START, QSSGRenderTextureCubeFaceNone, QSSGRHICTX_STAT, QRhiResource::rhi(), QSSGParticleRenderer::rhiRenderRenderable(), QSSGCustomMaterialSystem::rhiRenderRenderable(), state, QSSGRhiGraphicsPipelineState::UsesScissor, and QSSGRhiGraphicsPipelineState::UsesStencilRef.

Referenced by OpaquePass::render(), TransparentPass::render(), ScreenReflectionPass::renderPass(), and rhiRenderReflectionMap().

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

◆ rhiRenderShadowMap()

void RenderHelpers::rhiRenderShadowMap ( QSSGRhiContext * rhiCtx,
QSSGPassKey passKey,
QSSGRhiGraphicsPipelineState & ps,
QSSGRenderShadowMap & shadowMapManager,
const QSSGRenderCamera & camera,
const QSSGShaderLightList & globalLights,
const QSSGRenderableObjectList & sortedOpaqueObjects,
QSSGRenderer & renderer,
const QSSGBoxPoints & castingObjectsBox,
const QSSGBoxPoints & receivingObjectsBox )

Definition at line 1131 of file qssgrenderhelpers.cpp.

References QSSGRhiShaderResourceBindingList::addTexture(), QSSGRhiShaderResourceBindingList::addUniformBuffer(), camera, cb, QRhiSampler::ClampToEdge, QSSGRhiShaderResourceBindingList::clear(), QSSGRhiGraphicsPipelineState::colorAttachmentCount, QSSGRhiContext::commandBuffer(), QSSGRhiContext::commonPassFlags(), QRhiBuffer::create(), QMatrix4x4::data(), draw(), QRhiBuffer::Dynamic, QRhiShaderResourceBinding::FragmentStage, QSSGRhiContextPrivate::get(), QSSGLayerRenderData::getCurrent(), i, QRhi::isClipDepthZeroToOne(), QRhi::isYUpInFramebuffer(), QRhi::isYUpInNDC(), QRhiSampler::Linear, map, NegY, QRhi::newBuffer(), QRhiSampler::None, PosY, Q_ASSERT, Q_QUICK3D_PROFILE_END_WITH_IDS, Q_QUICK3D_PROFILE_END_WITH_STRING, Q_QUICK3D_PROFILE_START, QByteArrayLiteral, QSSG_ASSERT, QSSG_RENDERPASS_NAME, QSSGRenderTextureCubeFaceNone, QSSGRenderTextureCubeFaces, QSSGRHICTX_STAT, renderer, RENDERER_VISIBILITY_ALL, QRhiSampler::Repeat, QRhiResource::rhi(), QSSGRhiContext::rhi(), rhiPrepareResourcesForShadowMap(), QSSGRhiContext::sampler(), QSSGRhiGraphicsPipelineStatePrivate::setShaderPipeline(), setupCameraForShadowMap(), setupCubeShadowCameras(), QSSGRenderShadowMap::shadowMapEntry(), QVLABaseBase::size(), QSSGRhiDrawCallData::ubuf, QRhiBuffer::UniformBuffer, QSSGRhiQuadRenderer::UvCoords, QSSGRhiGraphicsPipelineState::viewport, and Qt::white.

+ Here is the call graph for this function: