193 qWarning(
"No QRhi found for window %p, QQuickRhiItem will not be functional",
m_window);
203 QSize newSize =
QSize(itemD->fixedTextureWidth, itemD->fixedTextureHeight);
235 qWarning(
"QQuickRhiItem: The requested texture format (%d) is not supported by the "
236 "underlying 3D graphics API implementation",
int(itemD->rhiTextureFormat));
241 qWarning(
"Failed to create backing texture for QQuickRhiItem");
248 if (itemD->samples > 1) {
251 qWarning(
"QQuickRhiItem: Multisample renderbuffers are reported as unsupported; "
252 "sample count %d will not work as expected", itemD->samples);
255 qWarning(
"QQuickRhiItem: The requested texture format (%d) is not supported by the "
256 "underlying 3D graphics API implementation",
int(itemD->rhiTextureFormat));
259 {}, itemD->rhiTextureFormat));
261 qWarning(
"Failed to create multisample color buffer for QQuickRhiItem");
270 qWarning(
"Failed to create resolve texture for QQuickRhiItem");
284 qWarning(
"Failed to rebuild texture for QQuickRhiItem after resizing");
290 qWarning(
"Failed to rebuild multisample color buffer for QQuickRhiitem after resizing");
296 qWarning(
"Failed to rebuild resolve texture for QQuickRhiItem after resizing");
300 QQuickWindow::CreateTextureOptions options;
302 options |= QQuickWindow::TextureHasAlphaChannel;
309 if (itemD->autoRenderTarget) {
315 qWarning(
"Failed to create depth-stencil buffer for QQuickRhiItem");
322 qWarning(
"Failed to rebuild depth-stencil buffer for QQuickRhiItem with new size");
332 if (itemD->samples > 1)
339 qWarning(
"Failed to create render target for QQuickRhiitem");
348 if (newSize != itemD->effectiveTextureSize) {
349 itemD->effectiveTextureSize = newSize;
372 qWarning(
"QQuickRhiItem: Neither swapchain nor redirected command buffer are available.");
430 if (!
d->node->hasRenderer()) {
434 d->node->setRenderer(
r);
436 qWarning(
"No QQuickRhiItemRenderer was created; the item will not render");
453 if (
window()->rhi()->isYUpInFramebuffer()) {
454 n->setTextureCoordinatesTransform(
d->mirrorVertically
458 n->setTextureCoordinatesTransform(
d->mirrorVertically
463 n->setRect(0, 0, qMax<int>(0,
width()), qMax<int>(0,
height()));
484 if (newGeometry.
size() != oldGeometry.
size())
499void QQuickRhiItem::invalidateSceneGraph()
605 return d->itemTextureFormat;
611 if (
d->itemTextureFormat ==
format)
643 return d->autoRenderTarget;
682 return d->mirrorVertically;
688 if (
d->mirrorVertically ==
enable)
718 return d->fixedTextureWidth;
724 if (
d->fixedTextureWidth ==
width)
727 d->fixedTextureWidth =
width;
754 return d->fixedTextureHeight;
760 if (
d->fixedTextureHeight ==
height)
763 d->fixedTextureHeight =
height;
792 return d->effectiveTextureSize;
898 return node ? node->
m_rhi :
nullptr;
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
bool event(QEvent *) override
\reimp
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
virtual void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
virtual QSGTextureProvider * textureProvider() const
Returns the texture provider for an item.
QQuickWindow * window() const
Returns the window in which this item is rendered.
qreal width
This property holds the width of this item.
qreal height
This property holds the height of this item.
bool enabled
\qmlproperty bool QtQuick::Item::enabled
void update()
Schedules a call to updatePaintNode() for this item.
virtual bool isTextureProvider() const
Returns true if this item is a texture provider.
QRhiTexture * m_colorTexture
QQuickRhiItemNode(QQuickRhiItem *item)
QRhiCommandBuffer * queryCommandBuffer()
void resetRenderTargetObjects()
std::unique_ptr< QRhiTextureRenderTarget > m_renderTarget
std::unique_ptr< QRhiRenderPassDescriptor > m_renderPassDescriptor
std::unique_ptr< QQuickRhiItemRenderer > m_renderer
std::unique_ptr< QRhiRenderBuffer > m_depthStencilBuffer
void resetColorBufferObjects()
std::unique_ptr< QSGTexture > m_sgTexture
QSGTexture * texture() const override
Returns a pointer to the texture object.
std::unique_ptr< QRhiRenderBuffer > m_msaaColorBuffer
QRhiTexture * m_resolveTexture
QRhiTexture * colorTexture() const
void update()
Call this function when the content of the offscreen color buffer should be updated.
QRhiRenderTarget * renderTarget() const
QRhiRenderBuffer * msaaColorBuffer() const
virtual ~QQuickRhiItemRenderer()
The Renderer is automatically deleted when the scene graph resources for the QQuickRhiItem item are c...
QRhiTexture * resolveTexture() const
QRhiRenderBuffer * depthStencilBuffer() const
QQuickRhiItemRenderer()
Constructs a new renderer.
void setSampleCount(int samples)
int fixedColorBufferHeight
The fixed height, in pixels, of the item's associated texture.
QSGNode * updatePaintNode(QSGNode *, UpdatePaintNodeData *) override
void autoRenderTargetChanged()
void colorBufferFormatChanged()
QQuickRhiItem(QQuickItem *parent=nullptr)
Constructs a new QQuickRhiItem with the given parent.
bool alphaBlending
Controls if blending is always enabled when drawing the quad textured with the content generated by t...
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
\reimp
void alphaBlendingChanged()
void setAlphaBlending(bool enable)
void effectiveColorBufferSizeChanged()
bool isMirrorVerticallyEnabled() const
void setMirrorVertically(bool enable)
int fixedColorBufferWidth
The fixed width, in pixels, of the item's associated texture or renderbuffer.
bool event(QEvent *) override
\reimp
void fixedColorBufferHeightChanged()
QSize effectiveColorBufferSize
This property exposes the size, in pixels, of the underlying color buffer (the QRhiTexture or QRhiRen...
void releaseResources() override
\reimp
friend class QQuickRhiItemNode
void setFixedColorBufferHeight(int height)
QSGTextureProvider * textureProvider() const override
\reimp
void mirrorVerticallyChanged()
void setFixedColorBufferWidth(int width)
TextureFormat colorBufferFormat
This property controls the texture format for the texture used as the color buffer.
void setColorBufferFormat(TextureFormat format)
~QQuickRhiItem() override
Destructor.
void sampleCountChanged()
bool isTextureProvider() const override
\reimp
void setAutoRenderTarget(bool enabled)
Controls if a depth-stencil QRhiRenderBuffer and a QRhiTextureRenderTarget is created and maintained ...
bool isAutoRenderTargetEnabled() const
void fixedColorBufferWidthChanged()
virtual QQuickRhiItemRenderer * createRenderer()=0
Reimplement this function to create and return a new instance of a QQuickRhiItemRenderer subclass.
int sampleCount
This property controls for sample count for multisample antialiasing.
void beforeRendering()
\qmlsignal QtQuick::Window::afterSynchronizing()
\inmodule QtCore\reentrant
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
void deleteLater()
When called without a frame being recorded, this function is equivalent to deleting the object.
virtual QRhiCommandBuffer * currentFrameCommandBuffer()=0
virtual bool create()=0
Creates the corresponding native graphics resources.
void setPixelSize(const QSize &sz)
Sets the texture size, specified in pixels, to sz.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags={}) const
int resourceLimit(ResourceLimit limit) const
bool isFeatureSupported(QRhi::Feature feature) const
QRhiRenderBuffer * newRenderBuffer(QRhiRenderBuffer::Type type, const QSize &pixelSize, int sampleCount=1, QRhiRenderBuffer::Flags flags={}, QRhiTexture::Format backingFormatHint=QRhiTexture::UnknownFormat)
QRhiTextureRenderTarget * newTextureRenderTarget(const QRhiTextureRenderTargetDescription &desc, QRhiTextureRenderTarget::Flags flags={})
QRhiTexture * newTexture(QRhiTexture::Format format, const QSize &pixelSize, int sampleCount=1, QRhiTexture::Flags flags={})
@ MultisampleRenderBuffer
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
An interface providing access to some of the graphics API specific internals of the scenegraph.
@ RhiRedirectCommandBuffer
void setTexture(QSGTexture *texture)
Sets the texture of this texture node to texture.
The QSGTextureProvider class encapsulates texture based entities in QML.
void textureChanged()
This signal is emitted when the texture changes.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
constexpr void setWidth(int w) noexcept
Sets the width to the given width.
constexpr bool isEmpty() const noexcept
Returns true if either of the width and height is less than or equal to 0; otherwise returns false.
constexpr void setHeight(int h) noexcept
Sets the height to the given height.
void screenChanged(QScreen *screen)
This signal is emitted when a window's screen changes, either by being set explicitly with setScreen(...
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLint GLsizei GLsizei height
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum format
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)