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>.
|
\inmodule QtQuick3D More...
#include <qssgrhicontext.h>
Public Member Functions | |
QSSGRhiContext (QRhi *rhi) | |
~QSSGRhiContext () | |
QRhi * | rhi () const |
bool | isValid () const |
QRhiRenderPassDescriptor * | mainRenderPassDescriptor () const |
QRhiCommandBuffer * | commandBuffer () const |
QRhiRenderTarget * | renderTarget () const |
int | mainPassSampleCount () const |
Returns the sample count used in the main render pass. | |
int | mainPassViewCount () const |
Returns the multiview count used in the main render pass. | |
QRhiSampler * | sampler (const QSSGRhiSamplerDescription &samplerDescription) |
void | checkAndAdjustForNPoT (QRhiTexture *texture, QSSGRhiSamplerDescription *samplerDescription) |
Adjusts samplerDescription's tiling and filtering modes based on the pixel size of texture. | |
QRhiTexture * | dummyTexture (QRhiTexture::Flags flags, QRhiResourceUpdateBatch *rub, const QSize &size=QSize(64, 64), const QColor &fillColor=Qt::black, int arraySize=0) |
QRhiCommandBuffer::BeginPassFlags | commonPassFlags () const |
|
explicit |
Definition at line 1029 of file qssgrhicontext.cpp.
References LightProbe, Q_ASSERT, Q_STATIC_ASSERT, and rhi().
QSSGRhiContext::~QSSGRhiContext | ( | ) |
Definition at line 1039 of file qssgrhicontext.cpp.
References d, and qDeleteAll().
void QSSGRhiContext::checkAndAdjustForNPoT | ( | QRhiTexture * | texture, |
QSSGRhiSamplerDescription * | samplerDescription ) |
Adjusts samplerDescription's tiling and filtering modes based on the pixel size of texture.
In most cases, samplerDescription is not changed. With older, legacy 3D APIs in use, there is however a chance that tiling modes such as \l{QRhiSampler::Repeat} are not supported for textures with a non-power-of-two width or height.
This convenience function helps creating robust applications that can still function even when features such as \l{QRhi::NPOTTextureRepeat} are not supported by an OpenGL ES 2.0 or WebGL 1 implementation at run time.
Definition at line 1289 of file qssgrhicontext.cpp.
References QRhiSampler::ClampToEdge, d, QSize::height(), QRhiSampler::None, QRhi::NPOTTextureRepeat, qNextPowerOfTwo(), qWarning, and QSize::width().
Referenced by RenderHelpers::rhiPrepareRenderable(), and QSSGCustomMaterialSystem::rhiPrepareRenderable().
QRhiCommandBuffer * QSSGRhiContext::commandBuffer | ( | ) | const |
Definition at line 1089 of file qssgrhicontext.cpp.
References d.
Referenced by addOpaqueDepthPrePassBindings(), QSSGLayerRenderData::maybeBakeLightmap(), QSSGRhiCubeRenderer::prepareCube(), QSSGLayerRenderData::prepareInstancing(), QSSGParticleRenderer::prepareParticlesForModel(), QSSGRhiQuadRenderer::prepareQuad(), QSSGRhiCubeRenderer::recordRenderCube(), QSSGDebugDrawSystem::recordRenderDebugObjects(), QSSGRhiQuadRenderer::recordRenderQuad(), QSSGRhiQuadRenderer::recordRenderQuadPass(), QSSGReflectionMapEntry::renderMips(), QQuick3DSceneRenderer::renderToRhiTexture(), RenderHelpers::rhiPrepareGrid(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), rhiPrepareResourcesForShadowMap(), RenderHelpers::rhiPrepareSkyBox(), RenderHelpers::rhiPrepareSkyBoxForReflectionMap(), RenderHelpers::rhiRenderAoTexture(), RenderHelpers::rhiRenderDepthPass(), RenderHelpers::rhiRenderReflectionMap(), RenderHelpers::rhiRenderRenderable(), QSSGParticleRenderer::rhiRenderRenderable(), QSSGCustomMaterialSystem::rhiRenderRenderable(), and RenderHelpers::rhiRenderShadowMap().
QRhiCommandBuffer::BeginPassFlags QSSGRhiContext::commonPassFlags | ( | ) | const |
Definition at line 1690 of file qssgrhicontext.cpp.
References QRhiCommandBuffer::DoNotTrackResourcesForCompute.
Referenced by QSSGRhiQuadRenderer::recordRenderQuadPass(), QSSGReflectionMapEntry::renderMips(), QQuick3DSceneRenderer::renderToRhiTexture(), RenderHelpers::rhiRenderReflectionMap(), and RenderHelpers::rhiRenderShadowMap().
QRhiTexture * QSSGRhiContext::dummyTexture | ( | QRhiTexture::Flags | flags, |
QRhiResourceUpdateBatch * | rub, | ||
const QSize & | size = QSize(64, 64), | ||
const QColor & | fillColor = Qt::black, | ||
int | arraySize = 0 ) |
This is intended to efficiently gain access to a "dummy" texture filled with a given fillColor, and reused in various places in the rendering stack.
rub must be a valid QRhiResourceUpdateBatch since this function will create a new texture and generate content for it, if a suitable cached object is not found. The necessary upload operations are then enqueued on this given update batch.
When arraySize is 2 or more, a 2D texture array is returned.
The ownership of the returned texture stays with Qt Quick 3D.
Definition at line 1380 of file qssgrhicontext.cpp.
References QSet< T >::constEnd(), QSet< T >::constFind(), d, QImage::Format_RGBA8888, it, QRhiResource::m_rhi, qWarning, and QRhiTexture::RGBA8.
Referenced by addOpaqueDepthPrePassBindings(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), and rhiPrepareResourcesForShadowMap().
bool QSSGRhiContext::isValid | ( | ) | const |
Definition at line 1060 of file qssgrhicontext.cpp.
References d.
Referenced by QSSGRenderer::rhiPrepare(), and QQuick3DSceneRenderer::synchronize().
int QSSGRhiContext::mainPassSampleCount | ( | ) | const |
Returns the sample count used in the main render pass.
Definition at line 1124 of file qssgrhicontext.cpp.
References d.
int QSSGRhiContext::mainPassViewCount | ( | ) | const |
Returns the multiview count used in the main render pass.
This is either 2, when multiview rendering is in use, or 1 (no multiview).
Definition at line 1139 of file qssgrhicontext.cpp.
References d.
Referenced by RenderHelpers::rhiPrepareAoTexture(), RenderHelpers::rhiPrepareDepthTexture(), rhiPrepareResourcesForShadowMap(), and RenderHelpers::rhiPrepareScreenTexture().
QRhiRenderPassDescriptor * QSSGRhiContext::mainRenderPassDescriptor | ( | ) | const |
Definition at line 1075 of file qssgrhicontext.cpp.
References d.
QRhiRenderTarget * QSSGRhiContext::renderTarget | ( | ) | const |
This can effectively be a render target from a swapchain, if the \l View3D uses a renderMode other than Offscreen. More commonly, the render target refers to a texture (i.e., is a QRhiTextureRenderTarget), e.g. because the renderMode is the default Offscreen, or because post-processing effects are in use.
Definition at line 1110 of file qssgrhicontext.cpp.
References d.
QRhi * QSSGRhiContext::rhi | ( | ) | const |
Definition at line 1051 of file qssgrhicontext.cpp.
References d.
Referenced by QSSGRhiBuffer::QSSGRhiBuffer(), QSSGRhiContext(), addOpaqueDepthPrePassBindings(), QSSGRhiShaderPipeline::addStage(), QSSGShaderCache::compileForRhi(), QSSGRhiShaderPipeline::ensureCombinedMainLightsUniformBuffer(), QSSGRhiShaderPipeline::ensureUniformBuffer(), QSSGRhiCubeRenderer::prepareCube(), QSSGLayerRenderData::prepareInstancing(), QSSGParticleRenderer::prepareParticlesForModel(), QSSGRhiQuadRenderer::prepareQuad(), QSSGReflectionMapEntry::renderMips(), QQuick3DSceneRenderer::renderToRhiTexture(), QSSGRenderer::rhiPrepare(), RenderHelpers::rhiPrepareAoTexture(), RenderHelpers::rhiPrepareDepthTexture(), RenderHelpers::rhiPrepareGrid(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), rhiPrepareResourcesForShadowMap(), RenderHelpers::rhiPrepareScreenTexture(), rhiPrepareSkyBox_helper(), RenderHelpers::rhiRenderAoTexture(), RenderHelpers::rhiRenderReflectionMap(), RenderHelpers::rhiRenderShadowMap(), QQuick3DRenderStats::setRhiContext(), QQuick3DSceneRenderer::synchronize(), QSSGCustomMaterialSystem::updateUniformsForCustomMaterial(), updateUniformsForDefaultMaterial(), and QSSGParticleRenderer::updateUniformsForParticles().
QRhiSampler * QSSGRhiContext::sampler | ( | const QSSGRhiSamplerDescription & | samplerDescription | ) |
The generated QRhiSampler objects are cached and reused. Thus this is a convenient way to gain access to a QRhiSampler with the given settings, without having to create a new, dedicated object all the time.
The ownership of the returned QRhiSampler stays with Qt Quick 3D.
Definition at line 1252 of file qssgrhicontext.cpp.
References QRhiSampler::create(), d, info, QRhiResource::m_rhi, and qWarning.
Referenced by addDepthTextureBindings(), addOpaqueDepthPrePassBindings(), QSSGParticleRenderer::prepareParticlesForModel(), QQuick3DSceneRenderer::renderToRhiTexture(), RenderHelpers::rhiPrepareRenderable(), QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), rhiPrepareResourcesForShadowMap(), rhiPrepareSkyBox_helper(), RenderHelpers::rhiRenderAoTexture(), and RenderHelpers::rhiRenderShadowMap().