![]() |
Qt 6.x
The Qt SDK
|
#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) |
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 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 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().
|
static |
Definition at line 137 of file qsgrhisupport.cpp.
References qEnvironmentVariableIsSet(), and QtDebugMsg.
Referenced by QSGRenderLoop::instance().
|
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().
Definition at line 875 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 611 of file qsgrhisupport.cpp.
References api, QSGRendererInterface::isApiRhiBased(), Q_ASSERT, and QSGRendererInterface::Unknown.
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().
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().
|
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().
QImage QSGRhiSupport::grabOffscreen | ( | QQuickWindow * | window | ) |
Definition at line 1321 of file qsgrhisupport.cpp.
References QRhi::beginOffscreenFrame(), cb, QQuickWindowPrivate::cleanupNodesOnShutdown(), QQuickWindowPrivate::context, createRhi(), QScopedPointer< T, Cleanup >::data(), QRhiRenderBuffer::DepthStencil, QRhi::endOffscreenFrame(), QRhi::FrameOpSuccess, QQuickRenderTarget::fromRhiRenderTarget(), QQuickWindowPrivate::get(), grabAndBlockInCurrentFrame(), QSGRenderContext::initialize(), QSGRenderContext::invalidate(), maybeCreateOffscreenSurface(), QRhi::newRenderBuffer(), QRhi::newTexture(), QRhi::newTextureRenderTarget(), QSGRhiSupport::RhiCreateResult::own, QQuickWindowPrivate::polishItems(), Q_ASSERT, qWarning, QQuickWindowPrivate::renderControl, QQuickWindowPrivate::renderSceneGraph(), QRhiTexture::RenderTarget, QRhiTexture::RGBA8, QQuickWindowPrivate::rhi, QSGRhiSupport::RhiCreateResult::rhi, QQuickWindowPrivate::setCustomCommandBuffer(), QRhiTextureRenderTargetDescription::setDepthStencilBuffer(), QQuickWindowPrivate::syncSceneGraph(), QRhiTexture::UsedAsTransferSource, and window().
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().
|
static |
Definition at line 631 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(), QSGRenderThread::handleDeviceLoss(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), QSGRenderThread::invalidateGraphics(), SharedTextureRegistry::preinitialize(), QQuickRenderControlPrivate::resetRhi(), QSGPlainTexture::setTextureFromNativeTexture(), QSGGuiThreadRenderLoop::windowDestroyed(), and QSGRenderLoop::windowSurfaceType().
|
static |
Definition at line 625 of file qsgrhisupport.cpp.
Referenced by instance().
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().
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().
|
inline |
Definition at line 65 of file qsgrhisupport_p.h.
Referenced by createRhi(), QQuickRenderControlPrivate::initRhi(), QSGRenderLoop::instance(), maybeCreateOffscreenSurface(), and prepareWindowForRhi().
QString QSGRhiSupport::rhiBackendName | ( | ) | const |
Definition at line 639 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 790 of file qsgrhisupport.cpp.
References cb, QQuickWindowPrivate::Redirect::commandBuffer, QSGDefaultRenderContext::currentFrameCommandBuffer(), QSGDefaultRenderContext::currentFrameRenderPass(), QRhi::D3D11, QRhi::D3D12, QQuickWindowPrivate::get(), QRhi::Metal, QRhiRenderPassDescriptor::nativeHandles(), QRhi::nativeHandles(), QRhi::OpenGLES2, QQuickWindowPrivate::redirect, QQuickWindowRenderTarget::renderTarget, QSGDefaultRenderContext::rhi(), QSGRendererInterface::RhiRedirectCommandBuffer, QSGRendererInterface::RhiRedirectRenderTarget, QSGRendererInterface::RhiResource, QSGRendererInterface::RhiSwapchainResource, QQuickWindowPrivate::Redirect::rt, QQuickWindowPrivate::swapchain, and QRhi::Vulkan.
Referenced by QSGDefaultContext::getResource().
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().
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().
QSGRendererInterface::GraphicsApi QSGRhiSupport::api |
Definition at line 101 of file qsgrhisupport_p.h.
Referenced by configure().
bool QSGRhiSupport::valid = false |
Definition at line 100 of file qsgrhisupport_p.h.