From 4f3dab116ba8942f02eed9df7261790b846dbb97 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 19 May 2026 14:06:59 +0100 Subject: [PATCH] Properly update docstrings with optional/default parameters --- qrenderdoc/Code/CaptureContext.cpp | 16 ++++++---- qrenderdoc/Code/CaptureContext.h | 17 +++++----- qrenderdoc/Code/Interface/Extensions.h | 40 +++++++++++------------- qrenderdoc/Code/Interface/QRDInterface.h | 18 ++++++----- qrenderdoc/Windows/BufferViewer.cpp | 6 ++++ renderdoc/api/replay/pipestate.h | 10 +++--- 6 files changed, 58 insertions(+), 49 deletions(-) diff --git a/qrenderdoc/Code/CaptureContext.cpp b/qrenderdoc/Code/CaptureContext.cpp index 6446d83ef..2ac84f66b 100644 --- a/qrenderdoc/Code/CaptureContext.cpp +++ b/qrenderdoc/Code/CaptureContext.cpp @@ -665,12 +665,12 @@ IMiniQtHelper &CaptureContext::GetMiniQtHelper() void CaptureContext::MessageDialog(const rdcstr &text, const rdcstr &title) { - RDDialog::information(m_MainWindow, title, text); + RDDialog::information(m_MainWindow, title.isEmpty() ? "Python Extension Message" : title, text); } void CaptureContext::ErrorDialog(const rdcstr &text, const rdcstr &title) { - RDDialog::critical(m_MainWindow, title, text); + RDDialog::critical(m_MainWindow, title.isEmpty() ? "Python Extension Error" : title, text); } DialogButton CaptureContext::QuestionDialog(const rdcstr &text, const rdcarray &options, @@ -679,22 +679,26 @@ DialogButton CaptureContext::QuestionDialog(const rdcstr &text, const rdcarray &items, diff --git a/qrenderdoc/Code/CaptureContext.h b/qrenderdoc/Code/CaptureContext.h index ba678d0fd..41e4a529e 100644 --- a/qrenderdoc/Code/CaptureContext.h +++ b/qrenderdoc/Code/CaptureContext.h @@ -95,19 +95,18 @@ public: IMiniQtHelper &GetMiniQtHelper() override; - void MessageDialog(const rdcstr &text, const rdcstr &title = "Python Extension Message") override; - void ErrorDialog(const rdcstr &text, const rdcstr &title = "Python Extension Error") override; + void MessageDialog(const rdcstr &text, const rdcstr &title = "") override; + void ErrorDialog(const rdcstr &text, const rdcstr &title = "") override; DialogButton QuestionDialog(const rdcstr &text, const rdcarray &options, - const rdcstr &title = "Python Extension Prompt") override; + const rdcstr &title = "") override; - rdcstr OpenFileName(const rdcstr &caption = "Open a file", const rdcstr &dir = rdcstr(), - const rdcstr &filter = rdcstr()) override; + rdcstr OpenFileName(const rdcstr &caption = "", const rdcstr &dir = "", + const rdcstr &filter = "") override; - rdcstr OpenDirectoryName(const rdcstr &caption = "Open a directory", - const rdcstr &dir = rdcstr()) override; + rdcstr OpenDirectoryName(const rdcstr &caption = "", const rdcstr &dir = "") override; - rdcstr SaveFileName(const rdcstr &caption = "Save a file", const rdcstr &dir = rdcstr(), - const rdcstr &filter = rdcstr()) override; + rdcstr SaveFileName(const rdcstr &caption = "", const rdcstr &dir = "", + const rdcstr &filter = "") override; ////////////////////////////////////////////////////////////////////////////// // Control functions diff --git a/qrenderdoc/Code/Interface/Extensions.h b/qrenderdoc/Code/Interface/Extensions.h index b200b6775..83371a98c 100644 --- a/qrenderdoc/Code/Interface/Extensions.h +++ b/qrenderdoc/Code/Interface/Extensions.h @@ -1200,60 +1200,58 @@ struct IExtensionManager DOCUMENT(R"(Display a simple informational message dialog. :param str text: The text of the dialog itself, required. -:param str title: The dialog title, optional. +:param str title="": **Optional parameter**. The dialog title. )"); - virtual void MessageDialog(const rdcstr &text, - const rdcstr &title = "Python Extension Message") = 0; + virtual void MessageDialog(const rdcstr &text, const rdcstr &title = "") = 0; DOCUMENT(R"(Display an error message dialog. :param str text: The text of the dialog itself, required. -:param str title: The dialog title, optional. +:param str title="": **Optional parameter**. The dialog title. )"); - virtual void ErrorDialog(const rdcstr &text, const rdcstr &title = "Python Extension Error") = 0; + virtual void ErrorDialog(const rdcstr &text, const rdcstr &title = "") = 0; DOCUMENT(R"(Display an error message dialog. :param str text: The text of the dialog itself, required. :param List[DialogButton] options: The buttons to display on the dialog. -:param str title: The dialog title, optional. +:param str title="": **Optional parameter**. The dialog title. :return: The button that was clicked on. :rtype: DialogButton )"); virtual DialogButton QuestionDialog(const rdcstr &text, const rdcarray &options, - const rdcstr &title = "Python Extension Prompt") = 0; + const rdcstr &title = "") = 0; DOCUMENT(R"(Browse for a filename to open. -:param str caption: The dialog title, optional. -:param str dir: The starting directory for browsing, optional. -:param str filter: The filter to apply for filenames, optional. +:param str caption="": **Optional parameter**. The dialog title. +:param str dir="": **Optional parameter**. The starting directory for browsing. +:param str filter="": **Optional parameter**. The filter to apply for filenames. :return: The filename selected, or an empty string if nothing was selected. :rtype: str )"); - virtual rdcstr OpenFileName(const rdcstr &caption = "Open a file", const rdcstr &dir = rdcstr(), - const rdcstr &filter = rdcstr()) = 0; + virtual rdcstr OpenFileName(const rdcstr &caption = "", const rdcstr &dir = "", + const rdcstr &filter = "") = 0; DOCUMENT(R"(Browse for a directory to open. -:param str caption: The dialog title, optional. -:param str dir: The starting directory for browsing, optional. +:param str caption="": **Optional parameter**. The dialog title. +:param str dir="": **Optional parameter**. The starting directory for browsing. :return: The directory selected, or an empty string if nothing was selected. :rtype: str )"); - virtual rdcstr OpenDirectoryName(const rdcstr &caption = "Open a directory", - const rdcstr &dir = rdcstr()) = 0; + virtual rdcstr OpenDirectoryName(const rdcstr &caption = "", const rdcstr &dir = "") = 0; DOCUMENT(R"(Browse for a filename to save to. -:param str caption: The dialog title, optional. -:param str dir: The starting directory for browsing, optional. -:param str filter: The filter to apply for filenames, optional. +:param str caption="": **Optional parameter**. The dialog title. +:param str dir="": **Optional parameter**. The starting directory for browsing. +:param str filter="": **Optional parameter**. The filter to apply for filenames. :return: The filename selected, or an empty string if nothing was selected. :rtype: str )"); - virtual rdcstr SaveFileName(const rdcstr &caption = "Save a file", const rdcstr &dir = rdcstr(), - const rdcstr &filter = rdcstr()) = 0; + virtual rdcstr SaveFileName(const rdcstr &caption = "", const rdcstr &dir = "", + const rdcstr &filter = "") = 0; #if !defined(SWIG) && !defined(SWIG_GENERATED) // not exposed to SWIG, only used internally. For when a menu is displayed dynamically in a panel, diff --git a/qrenderdoc/Code/Interface/QRDInterface.h b/qrenderdoc/Code/Interface/QRDInterface.h index 1c943eb86..1f60e342d 100644 --- a/qrenderdoc/Code/Interface/QRDInterface.h +++ b/qrenderdoc/Code/Interface/QRDInterface.h @@ -871,14 +871,16 @@ QWidget. DOCUMENT(R"(Scroll to the given row in the given stage's data. :param int row: the row to scroll to. -:param renderdoc.MeshDataStage stage: The stage of the geometry pipeline to scroll within. +:param renderdoc.MeshDataStage stage=renderdoc.MeshDataStage.VSIn: **Optional parameter**. The stage of the + geometry pipeline to scroll within. Ignored for non-mesh buffer viewers. )"); virtual void ScrollToRow(int32_t row, MeshDataStage stage = MeshDataStage::VSIn) = 0; DOCUMENT(R"(Scroll to the given column in the given stage's data. :param int column: the column to scroll to. -:param renderdoc.MeshDataStage stage: The stage of the geometry pipeline to scroll within. +:param renderdoc.MeshDataStage stage=renderdoc.MeshDataStage.VSIn: **Optional parameter**. The stage of the + geometry pipeline to scroll within. Ignored for non-mesh buffer viewers. )"); virtual void ScrollToColumn(int32_t column, MeshDataStage stage = MeshDataStage::VSIn) = 0; @@ -1376,8 +1378,8 @@ QWidget. DOCUMENT(R"(Toggles a breakpoint at a given instruction. -:param int instruction: The instruction to toggle breakpoint at. If this is ``-1`` the nearest - instruction after the current caret position is used. +:param int instruction=-1: **Optional parameter**. The instruction to toggle breakpoint at. + If this is ``-1`` the nearest instruction after the current caret position is used. )"); virtual void ToggleBreakpointOnInstruction(int32_t instruction = -1) = 0; @@ -2057,7 +2059,7 @@ The capture must be available locally, if it's not this function will fail. :meth:`CaptureViewer.OnSelectedEventChanged` for more information. :param int eventId: The new current :data:`eventId `. See :meth:`CaptureViewer.OnEventChanged` for more information. -:param bool force: Optional parameter, if ``True`` then the replay will 'move' even if it is moving +:param bool force=False: **Optional parameter**. if ``True`` then the replay will 'move' even if it is moving to the same :data:`eventId ` as it's currently on. )"); virtual void SetEventID(const rdcarray &exclude, uint32_t selectedEventId, @@ -2951,7 +2953,7 @@ This function should not be used to view the entirety of a descriptor store - in :param int byteOffset: The offset in bytes to the start of the buffer data to show. :param int byteSize: The number of bytes in the buffer to show. :param renderdoc.ResourceId id: The ID of the buffer to fetch data from. -:param str format: Optionally a HLSL/GLSL style formatting string. +:param str format="": **Optional parameter**. A HLSL/GLSL style formatting string. :return: The new :class:`BufferViewer` window opened, but not shown. :rtype: BufferViewer )"); @@ -2963,7 +2965,7 @@ bytes. :param renderdoc.ResourceId id: The ID of the texture itself. :param renderdoc.Subresource sub: The subresource within this texture to use. -:param str format: Optionally a HLSL/GLSL style formatting string. +:param str format="": **Optional parameter**. A HLSL/GLSL style formatting string. :return: The new :class:`BufferViewer` window opened, but not shown. :rtype: BufferViewer )"); @@ -3030,7 +3032,7 @@ currently docked. :param DockReference ref: The location to add the new window, possibly relative to ``refWindow``. :param QWidget refWindow: The window to refer to if the new window is being added relative, or can be ``None`` if the new location is absolute. -:param float percentage: Optionally the percentage to split the area. If omitted, a 50% split is +:param float percentage=0.5: **Optional parameter**. The percentage to split the area. If omitted, a 50% split is used. )"); virtual void AddDockWindow(QWidget *newWindow, DockReference ref, QWidget *refWindow, diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index fbf55d13a..def2f8430 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -5264,6 +5264,9 @@ void BufferViewer::ScrollToRow(int32_t row, MeshDataStage stage) return; } + if(!m_MeshView) + stage = MeshDataStage::VSIn; + ScrollToRow(tableForStage(stage), row); if(m_MeshView) @@ -5275,6 +5278,9 @@ void BufferViewer::ScrollToRow(int32_t row, MeshDataStage stage) void BufferViewer::ScrollToColumn(int32_t column, MeshDataStage stage) { + if(!m_MeshView) + stage = MeshDataStage::VSIn; + ScrollToColumn(tableForStage(stage), column); m_Scroll[(int)stage].setX(column); diff --git a/renderdoc/api/replay/pipestate.h b/renderdoc/api/replay/pipestate.h index 0401aec60..f00713dec 100644 --- a/renderdoc/api/replay/pipestate.h +++ b/renderdoc/api/replay/pipestate.h @@ -351,7 +351,7 @@ convenience of access. DOCUMENT(R"(Retrieves all descriptor information for all descriptors accessed at the current event. -:param bool onlyUsed: Omit descriptors bound or declared but not accessed. +:param bool onlyUsed=False: **Optional parameter**. Omit descriptors bound or declared but not accessed. :return: All descriptors accessed at the current event. :rtype: List[UsedDescriptor] )"); @@ -371,7 +371,7 @@ convenience of access. DOCUMENT(R"(Retrieves the constant blocks used by a particular shader stage. :param ShaderStage stage: The shader stage to fetch from. -:param bool onlyUsed: Omit descriptors bound or declared but not accessed. +:param bool onlyUsed=False: **Optional parameter**. Omit descriptors bound or declared but not accessed. :return: The currently bound constant blocks. :rtype: List[UsedDescriptor] )"); @@ -380,7 +380,7 @@ convenience of access. DOCUMENT(R"(Retrieves the read-only resources used by a particular shader stage. :param ShaderStage stage: The shader stage to fetch from. -:param bool onlyUsed: Omit descriptors bound or declared but not accessed. +:param bool onlyUsed=False: **Optional parameter**. Omit descriptors bound or declared but not accessed. :return: The currently bound read-only resources. :rtype: List[UsedDescriptor] )"); @@ -389,7 +389,7 @@ convenience of access. DOCUMENT(R"(Retrieves the samplers bound to a particular shader stage. :param ShaderStage stage: The shader stage to fetch from. -:param bool onlyUsed: Omit descriptors bound or declared but not accessed. +:param bool onlyUsed=False: **Optional parameter**. Omit descriptors bound or declared but not accessed. :return: The currently bound sampler resources. :rtype: List[UsedDescriptor] )"); @@ -398,7 +398,7 @@ convenience of access. DOCUMENT(R"(Retrieves the read/write resources used by a particular shader stage. :param ShaderStage stage: The shader stage to fetch from. -:param bool onlyUsed: Omit descriptors bound or declared but not accessed. +:param bool onlyUsed=False: **Optional parameter**. Omit descriptors bound or declared but not accessed. :return: The currently bound read/write resources. :rtype: List[UsedDescriptor] )");