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>.
|
The QGraphicsFrameCaptureRenderDoc class provides a way to capture a record of draw calls for different graphics APIs. More...
#include <qgraphicsframecapturerenderdoc_p_p.h>
Public Member Functions | |
QGraphicsFrameCaptureRenderDoc () | |
Creates a new object of this class. | |
~QGraphicsFrameCaptureRenderDoc ()=default | |
void | setRhi (QRhi *rhi) override |
void | startCaptureFrame () override |
Starts a frame capture using the set native handles provided through QGraphicsFrameCaptureRenderDoc::setRhi device. | |
void | endCaptureFrame () override |
Ends a frame capture started by a call to QGraphicsFrameCaptureRenderDoc::startCaptureFrame using the set native handles provided through QGraphicsFrameCaptureRenderDoc::setRhi. | |
bool | initialized () const override |
Returns true if the API is loaded and can capture frames or not. | |
bool | isCapturing () const override |
void | openCapture () override |
Public Member Functions inherited from QGraphicsFrameCapturePrivate | |
QGraphicsFrameCapturePrivate () | |
virtual | ~QGraphicsFrameCapturePrivate ()=default |
QString | capturePath () const |
virtual void | setCapturePath (const QString &path) |
QString | capturePrefix () const |
virtual void | setCapturePrefix (const QString &prefix) |
virtual QString | capturedFileName () const |
virtual QStringList | capturedFilesNames () const |
Additional Inherited Members | |
Protected Attributes inherited from QGraphicsFrameCapturePrivate | |
QRhi * | m_rhi = nullptr |
QRhiNativeHandles * | m_rhiHandles = nullptr |
void * | m_nativeHandle = nullptr |
QString | m_capturePath |
QString | m_capturePrefix |
QStringList | m_capturedFilesNames |
The QGraphicsFrameCaptureRenderDoc class provides a way to capture a record of draw calls for different graphics APIs.
For applications that render using graphics APIs like Vulkan or OpenGL, it would be convenient to have a way to check the draw calls done by the application. Specially for applications that make a large amount of draw calls and the output is different from what is expected.
This class acts as a wrapper over \l {https://renderdoc.org/}{RenderDoc} that allows applications to capture a rendered frame either programmatically, by clicking a key on the keyboard or both. The captured frame could be viewed later using RenderDoc GUI.
Read the \l {https://renderdoc.org/docs/index.html} {RenderDoc Documentation} for more information.
The functions that capture a frame like QGraphicsFrameCaptureRenderDoc::startCaptureFrame takes a device pointer as argument. This pointer is unique for each graphics API and is associated with the window that will be captured. This pointer has a default value of nullptr
. If no value is passed to the function the underlying API will try to find the device to use, but it is not guaranteed specially in a multi-window applications.
For OpenGL, the pointer should be the OpenGL context on the platform OpenGL is being used. For example, on Windows it should be HGLRC
.
For Vulkan, the pointer should point to the dispatch table within the VkInstance
.
Definition at line 28 of file qgraphicsframecapturerenderdoc_p_p.h.
QGraphicsFrameCaptureRenderDoc::QGraphicsFrameCaptureRenderDoc | ( | ) |
Creates a new object of this class.
The constructor will load RenderDoc library from the default path.
Only one instance of RenderDoc library is loaded at runtime which means creating several instances of this class will not affect the RenderDoc initialization.
Definition at line 96 of file qgraphicsframecapturerenderdoc.cpp.
|
default |
|
overridevirtual |
Ends a frame capture started by a call to QGraphicsFrameCaptureRenderDoc::startCaptureFrame using the set native handles provided through QGraphicsFrameCaptureRenderDoc::setRhi.
This function must be called after QGraphicsFrameCaptureRenderDoc::startCaptureFrame. Otherwise, a warning message will be printend and nothing will happen.
Implements QGraphicsFrameCapturePrivate.
Definition at line 197 of file qgraphicsframecapturerenderdoc.cpp.
References QString::fromUtf8(), initialized(), QGraphicsFrameCapturePrivate::m_capturedFilesNames, QGraphicsFrameCapturePrivate::m_nativeHandle, qCInfo, and qCWarning.
|
overridevirtual |
Returns true if the API is loaded and can capture frames or not.
Implements QGraphicsFrameCapturePrivate.
Definition at line 246 of file qgraphicsframecapturerenderdoc.cpp.
Referenced by endCaptureFrame(), isCapturing(), openCapture(), and startCaptureFrame().
|
overridevirtual |
Implements QGraphicsFrameCapturePrivate.
Definition at line 251 of file qgraphicsframecapturerenderdoc.cpp.
References initialized(), and qCWarning.
|
overridevirtual |
Implements QGraphicsFrameCapturePrivate.
Definition at line 262 of file qgraphicsframecapturerenderdoc.cpp.
References initialized(), and qCWarning.
Implements QGraphicsFrameCapturePrivate.
Definition at line 103 of file qgraphicsframecapturerenderdoc.cpp.
References QRhi::backend(), QRhi::D3D11, QRhi::D3D12, QGraphicsFrameCapturePrivate::m_nativeHandle, QRhi::Metal, QRhi::nativeHandles(), QRhi::Null, QRhi::OpenGLES2, qCWarning, and QRhi::Vulkan.
|
overridevirtual |
Starts a frame capture using the set native handles provided through QGraphicsFrameCaptureRenderDoc::setRhi device.
This function must be called before QGraphicsFrameCaptureRenderDoc::endCaptureFrame.
Implements QGraphicsFrameCapturePrivate.
Definition at line 165 of file qgraphicsframecapturerenderdoc.cpp.
References initialized(), QGraphicsFrameCapturePrivate::m_nativeHandle, qCInfo, and qCWarning.