diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index eac11638bf..afe79c6687 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -2211,6 +2211,14 @@ quint64 QRhiResource::globalResourceId() const return m_id; } +/*! + \return the QRhi that created this resource. + */ +QRhi *QRhiResource::rhi() const +{ + return m_rhi->q; +} + /*! \class QRhiBuffer \internal diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h index 1d0dce97c5..1d32d08e84 100644 --- a/src/gui/rhi/qrhi_p.h +++ b/src/gui/rhi/qrhi_p.h @@ -30,6 +30,7 @@ QT_BEGIN_NAMESPACE class QWindow; +class QRhi; class QRhiImplementation; class QRhiBuffer; class QRhiRenderBuffer; @@ -684,6 +685,8 @@ public: quint64 globalResourceId() const; + QRhi *rhi() const; + protected: QRhiResource(QRhiImplementation *rhi); Q_DISABLE_COPY(QRhiResource)