Qt 6.x
The Qt SDK
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)
 
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
 

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 1511 of file qsgrhisupport.cpp.

References QRhiSwapChain::HDR10, QRhiSwapChain::HDRExtendedSrgbLinear, QRhiSwapChain::hdrInfo(), QByteArray::isEmpty(), QRhiSwapChain::isFormatSupported(), Q_ASSERT, QByteArrayLiteral, qCDebug, qgetenv(), QRhiSwapChain::SDR, QRhiSwapChain::setFormat(), QByteArray::toLower(), window(), and QRhiSwapChain::window().

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

+ 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 850 of file qsgrhisupport.cpp.

References QListSpecialMethodsBase< T >::contains(), i, qEnvironmentVariableIntValue(), qEnvironmentVariableIsSet(), qMax(), qWarning, QList< T >::size(), and QRhi::supportedSampleCounts().

Referenced by chooseSampleCountForWindowWithRhi().

+ 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 875 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 611 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 
)

Definition at line 1093 of file qsgrhisupport.cpp.

References QQuickGraphicsDevicePrivate::adapter, backendName, QQuickGraphicsDevicePrivate::DeviceAndCommandQueue::cmdQueue, QQuickGraphicsDevicePrivate::DeviceAndContext::context, QQuickGraphicsDevicePrivate::context, QRhi::create(), QQuickWindowPrivate::customDeviceObjects, QRhi::D3D11, QRhi::D3D12, QQuickGraphicsDevicePrivate::DeviceAndContext::device, QQuickGraphicsDevicePrivate::DeviceAndCommandQueue::device, QQuickGraphicsDevicePrivate::DeviceObjects::device, QQuickGraphicsDevicePrivate::deviceAndCommandQueue, QQuickGraphicsDevicePrivate::deviceAndContext, QQuickGraphicsConfiguration::deviceExtensions(), QQuickGraphicsDevicePrivate::deviceObjects, QRhi::EnableDebugMarkers, QRhi::EnablePipelineCacheDataSave, QRhi::EnableTimestamps, QQuickGraphicsDevicePrivate::Adapter::featureLevel, QQuickGraphicsDevicePrivate::get(), QQuickWindowPrivate::get(), QQuickWindowPrivate::graphicsConfig, QQuickGraphicsConfiguration::isAutomaticPipelineCacheEnabled(), isAutomaticPipelineCacheSaveSkippedForWindow(), QQuickGraphicsConfiguration::isDebugLayerEnabled(), QQuickGraphicsConfiguration::isDebugMarkersEnabled(), QString::isEmpty(), QQuickGraphicsConfiguration::isTimestampsEnabled(), QQuickGraphicsDevicePrivate::Adapter::luidHigh, QQuickGraphicsDevicePrivate::Adapter::luidLow, QRhi::Metal, QRhi::Null, QRhi::OpenGLES2, QQuickGraphicsDevicePrivate::PhysicalDevice::physicalDevice, QQuickGraphicsDevicePrivate::DeviceObjects::physicalDevice, QQuickGraphicsDevicePrivate::physicalDevice, QQuickGraphicsConfiguration::pipelineCacheSaveFile(), QRhi::PreferSoftwareRenderer, QQuickGraphicsConfiguration::prefersSoftwareDevice(), prepareWindowForRhi(), Q_UNUSED, qCDebug, qPrintable, QQuickGraphicsDevicePrivate::DeviceObjects::queueFamilyIndex, QQuickGraphicsDevicePrivate::DeviceObjects::queueIndex, qWarning, QQuickGraphicsDevicePrivate::rhi, rhiBackend(), rhiBackendName(), QQuickGraphicsDevicePrivate::type, QQuickGraphicsDevicePrivate::u, QRhi::Vulkan, and window().

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

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

◆ destroyRhi()

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

Definition at line 1276 of file qsgrhisupport.cpp.

References QRhi::isDeviceLost().

Referenced by QSGGuiThreadRenderLoop::handleDeviceLoss(), QSGRenderThread::handleDeviceLoss(), QSGRenderThread::invalidateGraphics(), QQuickRenderControlPrivate::resetRhi(), and QSGGuiThreadRenderLoop::windowDestroyed().

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

◆ grabAndBlockInCurrentFrame()

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

Definition at line 1287 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 QSGRenderThread::event(), QSGGuiThreadRenderLoop::grab(), and grabOffscreen().

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

◆ grabOffscreen()

◆ graphicsApi()

QSGRendererInterface::GraphicsApi QSGRhiSupport::graphicsApi ( ) const

Definition at line 644 of file qsgrhisupport.cpp.

References QRhi::D3D11, QRhi::D3D12, QSGRendererInterface::Direct3D11, QSGRendererInterface::Direct3D12, QRhi::Metal, QSGRendererInterface::Metal, QRhi::Null, QSGRendererInterface::Null, QSGRendererInterface::OpenGL, QRhi::OpenGLES2, QSGRendererInterface::Unknown, QRhi::Vulkan, and QSGRendererInterface::Vulkan.

Referenced by QSGDefaultContext::graphicsApi().

+ Here is the caller graph for this function:

◆ instance()

◆ instance_internal()

QSGRhiSupport * QSGRhiSupport::instance_internal ( )
static

Definition at line 625 of file qsgrhisupport.cpp.

Referenced by instance().

+ Here is the caller graph for this function:

◆ maybeCreateOffscreenSurface()

QOffscreenSurface * QSGRhiSupport::maybeCreateOffscreenSurface ( QWindow window)

Definition at line 881 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 895 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 createRhi(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), maybeCreateOffscreenSurface(), and prepareWindowForRhi().

+ Here is the caller graph for this function:

◆ rhiBackendName()

QString QSGRhiSupport::rhiBackendName ( ) const

Definition at line 639 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()

◆ toRhiTextureFormat()

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

Definition at line 1564 of file qsgrhisupport.cpp.

References QRhi::D3D11, QRhi::D3D12, QRhi::Metal, QRhi::OpenGLES2, Q_UNUSED, QRhiTexture::UnknownFormat, and QRhi::Vulkan.

Referenced by QSGPlainTexture::setTextureFromNativeTexture().

+ Here is the caller graph for this function:

◆ windowSurfaceType()

QSurface::SurfaceType QSGRhiSupport::windowSurfaceType ( ) const

Definition at line 664 of file qsgrhisupport.cpp.

References QRhi::D3D11, QRhi::D3D12, QSurface::Direct3DSurface, QRhi::Metal, QSurface::MetalSurface, QRhi::OpenGLES2, QSurface::OpenGLSurface, QRhi::Vulkan, and QSurface::VulkanSurface.

Referenced by QSGRenderLoop::windowSurfaceType().

+ Here is the caller graph for this function:

Member Data Documentation

◆ api

Definition at line 101 of file qsgrhisupport_p.h.

Referenced by configure().

◆ valid

bool QSGRhiSupport::valid = false

Definition at line 100 of file qsgrhisupport_p.h.


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