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>.
Loading...
Searching...
No Matches
QGraphicsFrameCaptureRenderDoc Class Reference

The QGraphicsFrameCaptureRenderDoc class provides a way to capture a record of draw calls for different graphics APIs. More...

#include <qgraphicsframecapturerenderdoc_p_p.h>

+ Inheritance diagram for QGraphicsFrameCaptureRenderDoc:
+ Collaboration diagram for QGraphicsFrameCaptureRenderDoc:

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
QRhim_rhi = nullptr
 
QRhiNativeHandlesm_rhiHandles = nullptr
 
voidm_nativeHandle = nullptr
 
QString m_capturePath
 
QString m_capturePrefix
 
QStringList m_capturedFilesNames
 

Detailed Description

The QGraphicsFrameCaptureRenderDoc class provides a way to capture a record of draw calls for different graphics APIs.

Since
6.6 \inmodule QtGui

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.

Constructor & Destructor Documentation

◆ QGraphicsFrameCaptureRenderDoc()

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.

◆ ~QGraphicsFrameCaptureRenderDoc()

QGraphicsFrameCaptureRenderDoc::~QGraphicsFrameCaptureRenderDoc ( )
default

Member Function Documentation

◆ endCaptureFrame()

void QGraphicsFrameCaptureRenderDoc::endCaptureFrame ( )
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.

See also
{API device handle}

Implements QGraphicsFrameCapturePrivate.

Definition at line 197 of file qgraphicsframecapturerenderdoc.cpp.

References QString::fromUtf8(), initialized(), QGraphicsFrameCapturePrivate::m_capturedFilesNames, QGraphicsFrameCapturePrivate::m_nativeHandle, qCInfo, and qCWarning.

+ Here is the call graph for this function:

◆ initialized()

bool QGraphicsFrameCaptureRenderDoc::initialized ( ) const
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().

+ Here is the caller graph for this function:

◆ isCapturing()

bool QGraphicsFrameCaptureRenderDoc::isCapturing ( ) const
overridevirtual

Implements QGraphicsFrameCapturePrivate.

Definition at line 251 of file qgraphicsframecapturerenderdoc.cpp.

References initialized(), and qCWarning.

+ Here is the call graph for this function:

◆ openCapture()

void QGraphicsFrameCaptureRenderDoc::openCapture ( )
overridevirtual

Implements QGraphicsFrameCapturePrivate.

Definition at line 262 of file qgraphicsframecapturerenderdoc.cpp.

References initialized(), and qCWarning.

+ Here is the call graph for this function:

◆ setRhi()

void QGraphicsFrameCaptureRenderDoc::setRhi ( QRhi * rhi)
overridevirtual

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.

+ Here is the call graph for this function:

◆ startCaptureFrame()

void QGraphicsFrameCaptureRenderDoc::startCaptureFrame ( )
overridevirtual

Starts a frame capture using the set native handles provided through QGraphicsFrameCaptureRenderDoc::setRhi device.

This function must be called before QGraphicsFrameCaptureRenderDoc::endCaptureFrame.

See also
{API device handle}

Implements QGraphicsFrameCapturePrivate.

Definition at line 165 of file qgraphicsframecapturerenderdoc.cpp.

References initialized(), QGraphicsFrameCapturePrivate::m_nativeHandle, qCInfo, and qCWarning.

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: