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>.
|
#include <qsgrhisupport_p.h>
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 void * | rifResource (QSGRendererInterface::Resource res, const QSGDefaultRenderContext *rc, const QQuickWindow *w) |
QOffscreenSurface * | maybeCreateOffscreenSurface (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 QSGRhiSupport * | instance_internal () |
static QSGRhiSupport * | instance () |
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 () |
Definition at line 37 of file qsgrhisupport_p.h.
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().
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().
|
static |
Definition at line 137 of file qsgrhisupport.cpp.
References qEnvironmentVariableIsSet(), and QtDebugMsg.
Referenced by QSGRenderLoop::instance().
|
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().
Definition at line 889 of file qsgrhisupport.cpp.
References chooseSampleCount(), QSurfaceFormat::defaultFormat(), qMax(), and window().
Referenced by QSGRenderThread::ensureRhi(), and QSGGuiThreadRenderLoop::ensureRhi().
void QSGRhiSupport::configure | ( | QSGRendererInterface::GraphicsApi | api | ) |
Definition at line 625 of file qsgrhisupport.cpp.
References api, QSGRendererInterface::isApiRhiBased(), Q_ASSERT, and QSGRendererInterface::Unknown.
QSGRhiSupport::RhiCreateResult QSGRhiSupport::createRhi | ( | QQuickWindow * | window, |
QSurface * | offscreenSurface, | ||
bool | forcePreferSwRenderer = false ) |
Definition at line 1107 of file qsgrhisupport.cpp.
References attemptReinitWithSwRastUponFail(), backendName, QRhi::create(), QQuickWindowPrivate::customDeviceObjects, QRhi::D3D11, QRhi::D3D12, QQuickGraphicsConfiguration::deviceExtensions(), QRhi::EnableDebugMarkers, QRhi::EnablePipelineCacheDataSave, QRhi::EnableTimestamps, QQuickGraphicsDevicePrivate::get(), QQuickWindowPrivate::get(), QQuickWindowPrivate::graphicsConfig, QQuickGraphicsConfiguration::isAutomaticPipelineCacheEnabled(), isAutomaticPipelineCacheSaveSkippedForWindow(), QQuickGraphicsConfiguration::isDebugLayerEnabled(), QQuickGraphicsConfiguration::isDebugMarkersEnabled(), QString::isEmpty(), QRhi::Metal, QRhi::Null, QRhi::OpenGLES2, QQuickGraphicsConfiguration::pipelineCacheSaveFile(), QRhi::PreferSoftwareRenderer, QQuickGraphicsConfiguration::prefersSoftwareDevice(), prepareWindowForRhi(), Q_UNUSED, qCDebug, qPrintable, qWarning, rhiBackend(), rhiBackendName(), QRhi::SuppressSmokeTestWarnings, QQuickGraphicsConfiguration::timestampsEnabled(), QRhi::Vulkan, and window().
Referenced by QSGRenderThread::ensureRhi(), QSGGuiThreadRenderLoop::ensureRhi(), grabOffscreen(), and QQuickRenderControlPrivate::initRhi().
void QSGRhiSupport::destroyRhi | ( | QRhi * | rhi, |
const QQuickGraphicsConfiguration & | config ) |
Definition at line 1291 of file qsgrhisupport.cpp.
References QRhi::isDeviceLost().
|
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().
QImage QSGRhiSupport::grabOffscreen | ( | QQuickWindow * | window | ) |
Definition at line 1336 of file qsgrhisupport.cpp.
References QRhi::beginOffscreenFrame(), cb, QQuickWindowPrivate::cleanupNodesOnShutdown(), QQuickWindowPrivate::context, createRhi(), QRhiRenderBuffer::DepthStencil, QRhi::endOffscreenFrame(), QRhi::FrameOpSuccess, QQuickRenderTarget::fromRhiRenderTarget(), QQuickWindowPrivate::get(), grabAndBlockInCurrentFrame(), QSGRenderContext::initialize(), QSGRenderContext::invalidate(), maybeCreateOffscreenSurface(), QRhi::newRenderBuffer(), QRhi::newTexture(), QRhi::newTextureRenderTarget(), QQuickWindowPrivate::polishItems(), Q_ASSERT, qWarning, QQuickWindowPrivate::renderControl, QQuickWindowPrivate::renderSceneGraph(), QRhiTexture::RenderTarget, QRhiTexture::RGBA8, QQuickWindowPrivate::rhi, QSGDefaultRenderContext::InitParams::rhi, QQuickWindowPrivate::setCustomCommandBuffer(), QQuickWindowPrivate::syncSceneGraph(), QRhiTexture::UsedAsTransferSource, and window().
QSGRendererInterface::GraphicsApi QSGRhiSupport::graphicsApi | ( | ) | const |
Definition at line 658 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.
|
static |
Definition at line 645 of file qsgrhisupport.cpp.
References instance_internal().
Referenced by QSGRenderThread::ensureRhi(), QSGGuiThreadRenderLoop::ensureRhi(), QSGRenderThread::event(), QSGDefaultContext::getResource(), QSGGuiThreadRenderLoop::grab(), QSGDefaultContext::graphicsApi(), QSGRenderLoop::handleContextCreationFailure(), QSGGuiThreadRenderLoop::handleDeviceLoss(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), QSGRenderThread::invalidateGraphics(), SharedTextureRegistry::preinitialize(), QSGGuiThreadRenderLoop::renderWindow(), QQuickRenderControlPrivate::resetRhi(), QSGPlainTexture::setTextureFromNativeTexture(), QSGRenderThread::syncAndRender(), QSGGuiThreadRenderLoop::teardownGraphics(), QSGRenderThread::teardownGraphics(), QSGGuiThreadRenderLoop::windowDestroyed(), and QSGRenderLoop::windowSurfaceType().
|
static |
Definition at line 639 of file qsgrhisupport.cpp.
Referenced by instance().
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().
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().
|
inline |
Definition at line 65 of file qsgrhisupport_p.h.
Referenced by attemptReinitWithSwRastUponFail(), createRhi(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), maybeCreateOffscreenSurface(), and prepareWindowForRhi().
QString QSGRhiSupport::rhiBackendName | ( | ) | const |
Definition at line 653 of file qsgrhisupport.cpp.
References QRhi::backendName(), and QString::fromUtf8().
Referenced by createRhi().
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().
QRhiTexture::Format QSGRhiSupport::toRhiTextureFormat | ( | uint | nativeFormat, |
QRhiTexture::Flags * | flags ) const |
Definition at line 1581 of file qsgrhisupport.cpp.
References QRhi::D3D11, QRhi::D3D12, QRhi::Metal, QRhi::OpenGLES2, Q_UNUSED, QRhiTexture::UnknownFormat, and QRhi::Vulkan.
QSurface::SurfaceType QSGRhiSupport::windowSurfaceType | ( | ) | const |
Definition at line 678 of file qsgrhisupport.cpp.
References QRhi::D3D11, QRhi::D3D12, QSurface::Direct3DSurface, QRhi::Metal, QSurface::MetalSurface, QRhi::OpenGLES2, QSurface::OpenGLSurface, QRhi::Vulkan, and QSurface::VulkanSurface.
QSGRendererInterface::GraphicsApi QSGRhiSupport::api |
Definition at line 103 of file qsgrhisupport_p.h.
Referenced by configure().
bool QSGRhiSupport::valid = false |
Definition at line 102 of file qsgrhisupport_p.h.