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

#include <qsgrhisupport_p.h>

+ Collaboration diagram for QSGRhiSupport:

Classes

struct  RhiCreateResult
 

Public Member Functions

void configure (QSGRendererInterface::GraphicsApi api)
 
QRhi::Implementation rhiBackend () const
 
QString rhiBackendName () const
 
QSGRendererInterface::GraphicsApi graphicsApi () const
 
QSurface::SurfaceType windowSurfaceType () const
 
const voidrifResource (QSGRendererInterface::Resource res, const QSGDefaultRenderContext *rc, const QQuickWindow *w)
 
QOffscreenSurfacemaybeCreateOffscreenSurface (QWindow *window)
 
RhiCreateResult createRhi (QQuickWindow *window, QSurface *offscreenSurface, bool forcePreferSwRenderer=false)
 
void destroyRhi (QRhi *rhi, const QQuickGraphicsConfiguration &config)
 
void prepareWindowForRhi (QQuickWindow *window)
 
QImage grabOffscreen (QQuickWindow *window)
 
void applySwapChainFormat (QRhiSwapChain *scWithWindowSet, QQuickWindow *window)
 
QRhiTexture::Format toRhiTextureFormat (uint nativeFormat, QRhiTexture::Flags *flags) const
 
bool attemptReinitWithSwRastUponFail () const
 

Static Public Member Functions

static QSGRhiSupportinstance_internal ()
 
static QSGRhiSupportinstance ()
 
static int chooseSampleCount (int samples, QRhi *rhi)
 
static int chooseSampleCountForWindowWithRhi (QWindow *window, QRhi *rhi)
 
static QImage grabAndBlockInCurrentFrame (QRhi *rhi, QRhiCommandBuffer *cb, QRhiTexture *src=nullptr)
 
static void checkEnvQSgInfo ()
 

Detailed Description

Definition at line 37 of file qsgrhisupport_p.h.

Member Function Documentation

◆ applySwapChainFormat()

void QSGRhiSupport::applySwapChainFormat ( QRhiSwapChain * scWithWindowSet,
QQuickWindow * window )

Definition at line 1526 of file qsgrhisupport.cpp.

References QRhiSwapChain::HDR10, QRhiSwapChain::HDRExtendedDisplayP3Linear, QRhiSwapChain::HDRExtendedSrgbLinear, Q_ASSERT, QByteArrayLiteral, qCDebug, qgetenv(), QRhiSwapChain::SDR, and window().

Referenced by QSGGuiThreadRenderLoop::ensureRhi().

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

◆ attemptReinitWithSwRastUponFail()

bool QSGRhiSupport::attemptReinitWithSwRastUponFail ( ) const

Definition at line 1609 of file qsgrhisupport.cpp.

References QRhi::D3D11, QRhi::D3D12, and rhiBackend().

Referenced by createRhi(), QSGGuiThreadRenderLoop::renderWindow(), and QSGRenderThread::syncAndRender().

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

◆ checkEnvQSgInfo()

void QSGRhiSupport::checkEnvQSgInfo ( )
static

Definition at line 137 of file qsgrhisupport.cpp.

References qEnvironmentVariableIsSet(), and QtDebugMsg.

Referenced by QSGRenderLoop::instance().

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

◆ chooseSampleCount()

int QSGRhiSupport::chooseSampleCount ( int samples,
QRhi * rhi )
static

Definition at line 864 of file qsgrhisupport.cpp.

References i, qEnvironmentVariableIntValue(), qEnvironmentVariableIsSet(), qMax(), qWarning, and QRhi::supportedSampleCounts().

Referenced by chooseSampleCountForWindowWithRhi(), createRhiRenderTarget(), createRhiRenderTargetMultiView(), createRhiRenderTargetWithDepthTexture(), and createRhiRenderTargetWithRenderBuffer().

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

◆ chooseSampleCountForWindowWithRhi()

int QSGRhiSupport::chooseSampleCountForWindowWithRhi ( QWindow * window,
QRhi * rhi )
static

Definition at line 889 of file qsgrhisupport.cpp.

References chooseSampleCount(), QSurfaceFormat::defaultFormat(), qMax(), and window().

Referenced by QSGRenderThread::ensureRhi(), and QSGGuiThreadRenderLoop::ensureRhi().

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

◆ configure()

void QSGRhiSupport::configure ( QSGRendererInterface::GraphicsApi api)

Definition at line 625 of file qsgrhisupport.cpp.

References api, QSGRendererInterface::isApiRhiBased(), Q_ASSERT, and QSGRendererInterface::Unknown.

+ Here is the call graph for this function:

◆ createRhi()

QSGRhiSupport::RhiCreateResult QSGRhiSupport::createRhi ( QQuickWindow * window,
QSurface * offscreenSurface,
bool forcePreferSwRenderer = false )

◆ destroyRhi()

void QSGRhiSupport::destroyRhi ( QRhi * rhi,
const QQuickGraphicsConfiguration & config )

Definition at line 1291 of file qsgrhisupport.cpp.

References QRhi::isDeviceLost().

+ Here is the call graph for this function:

◆ grabAndBlockInCurrentFrame()

QImage QSGRhiSupport::grabAndBlockInCurrentFrame ( QRhi * rhi,
QRhiCommandBuffer * cb,
QRhiTexture * src = nullptr )
static

Definition at line 1302 of file qsgrhisupport.cpp.

References QRhiTexture::BGRA8, cb, QRhi::finish(), QImage::Format_ARGB32_Premultiplied, QImage::Format_RGBA8888_Premultiplied, QRhi::isRecordingFrame(), QRhi::isYUpInFramebuffer(), QRhi::nextResourceUpdateBatch(), Q_ASSERT, and QRhiResourceUpdateBatch::readBackTexture().

Referenced by grabOffscreen().

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

◆ grabOffscreen()

◆ graphicsApi()

◆ instance()

◆ instance_internal()

QSGRhiSupport * QSGRhiSupport::instance_internal ( )
static

Definition at line 639 of file qsgrhisupport.cpp.

Referenced by instance().

+ Here is the caller graph for this function:

◆ maybeCreateOffscreenSurface()

QOffscreenSurface * QSGRhiSupport::maybeCreateOffscreenSurface ( QWindow * window)

Definition at line 895 of file qsgrhisupport.cpp.

References QRhi::OpenGLES2, Q_UNUSED, rhiBackend(), and window().

Referenced by QSGGuiThreadRenderLoop::ensureRhi(), grabOffscreen(), and QQuickRenderControlPrivate::initRhi().

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

◆ prepareWindowForRhi()

void QSGRhiSupport::prepareWindowForRhi ( QQuickWindow * window)

Definition at line 909 of file qsgrhisupport.cpp.

References QQuickWindowPrivate::get(), Q_UNUSED, qCDebug, QQuickWindowPrivate::renderControl, rhiBackend(), QRhi::Vulkan, and window().

Referenced by createRhi(), and QSGGuiThreadRenderLoop::ensureRhi().

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

◆ rhiBackend()

QRhi::Implementation QSGRhiSupport::rhiBackend ( ) const
inline

Definition at line 65 of file qsgrhisupport_p.h.

Referenced by attemptReinitWithSwRastUponFail(), createRhi(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), maybeCreateOffscreenSurface(), and prepareWindowForRhi().

+ Here is the caller graph for this function:

◆ rhiBackendName()

QString QSGRhiSupport::rhiBackendName ( ) const

Definition at line 653 of file qsgrhisupport.cpp.

References QRhi::backendName(), and QString::fromUtf8().

Referenced by createRhi().

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

◆ rifResource()

const void * QSGRhiSupport::rifResource ( QSGRendererInterface::Resource res,
const QSGDefaultRenderContext * rc,
const QQuickWindow * w )

Definition at line 804 of file qsgrhisupport.cpp.

References cb, QSGDefaultRenderContext::currentFrameCommandBuffer(), QSGDefaultRenderContext::currentFrameRenderPass(), QRhi::D3D11, QRhi::D3D12, QQuickWindowPrivate::get(), QRhi::Metal, QRhiRenderPassDescriptor::nativeHandles(), QRhi::nativeHandles(), QRhi::OpenGLES2, QSGDefaultRenderContext::rhi(), QSGRendererInterface::RhiRedirectCommandBuffer, QSGRendererInterface::RhiRedirectRenderTarget, QSGRendererInterface::RhiResource, QSGRendererInterface::RhiSwapchainResource, and QRhi::Vulkan.

Referenced by QSGDefaultContext::getResource().

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

◆ toRhiTextureFormat()

QRhiTexture::Format QSGRhiSupport::toRhiTextureFormat ( uint nativeFormat,
QRhiTexture::Flags * flags ) const

◆ windowSurfaceType()

Member Data Documentation

◆ api

Definition at line 103 of file qsgrhisupport_p.h.

Referenced by configure().

◆ valid

bool QSGRhiSupport::valid = false

Definition at line 102 of file qsgrhisupport_p.h.


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