From dd8d3b5c2073f25901f3fb62774dd907204d86b7 Mon Sep 17 00:00:00 2001 From: William Pearson Date: Wed, 8 Nov 2023 12:42:28 -0700 Subject: [PATCH 1/2] Add missing brackets to docs/how/how_buffer_format.rst --- docs/how/how_buffer_format.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/how/how_buffer_format.rst b/docs/how/how_buffer_format.rst index 294f45f736..708c62fd81 100644 --- a/docs/how/how_buffer_format.rst +++ b/docs/how/how_buffer_format.rst @@ -162,13 +162,13 @@ The buffer format supports annotations on declarations to specify special proper Struct definitions support the following annotations: * ``[[size(number)]]`` or ``[[byte_size(number)]]`` - Forces the struct to be padded up to a given size even if the contents don't require it. -* ``[[single]]`` or ``[fixed]]`` - Forces the struct to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See the below section for more details. Structs with this annotation **may not** be declared as a variable, and should instead be the implicit final struct in a definition. +* ``[[single]]`` or ``[[fixed]]`` - Forces the struct to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See the below section for more details. Structs with this annotation **may not** be declared as a variable, and should instead be the implicit final struct in a definition. Variable declarations support the following annotations: * ``[[offset(number)]]`` or ``[[byte_offset(number)]]`` - Forces this member to be at a given offset **relative to its parent**. This cannot place the member any earlier than it would have according to tight packing with the current packing rules. * ``[[pad]]`` or ``[[padding]]`` - Mark this member as padding, such that structure layout is calculated accounting for it but it is not displayed visibly. -* ``[[single]]`` or ``[fixed]]`` - Forces this variable to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See :ref:`the below section ` for more details. This must be a global variable, and it must be the only global variable in the format definition. +* ``[[single]]`` or ``[[fixed]]`` - Forces this variable to be considered as a fixed SoA definition, even if in context the buffer viewer may default to AoS. See :ref:`the below section ` for more details. This must be a global variable, and it must be the only global variable in the format definition. * ``[[row_major]]`` or ``[[col_major]]`` - Declares the memory order for a matrix. * ``[[rgb]]`` - Will color the background of any repeated data by interpreting its contents as RGB color. * ``[[hex]]`` or ``[[hexadecimal]]`` - Will show integer data as hexadecimal. @@ -209,7 +209,7 @@ In the opposite direction, normally a loose collection of variables without any float c; }; -However if the desire is to display this as a single fixed element where the fixed tree view is more appropriate, the structure or an variable of it can be annotated as ``[single]]`` or ``[[fixed]]``. +However if the desire is to display this as a single fixed element where the fixed tree view is more appropriate, the structure or an variable of it can be annotated as ``[[single]]`` or ``[[fixed]]``. .. code:: c++ From 2916ecbe93adcde9454624451dfdbee6b1299849 Mon Sep 17 00:00:00 2001 From: William Pearson Date: Wed, 8 Nov 2023 12:43:43 -0700 Subject: [PATCH 2/2] Fix links in buffer format help The buffer format help can be accessed via first opening the raw buffer viewer (e.g. from the actions section on the texture viewer), and then clicking the "?" under saved formats. It includes a nice summary of the format syntax, but says that "Exhaustive documentation can be found in the online docs." That was supposed to include a link to https://renderdoc.org/docs/how/how_buffer_format.html, and in fact it renders as if it were link, but clicking on it did nothing. This has been fixed by adding `Qt::LinksAccessibleByMouse` and `Qt::LinksAccessibleByKeyboard` to `textInteractionFlags`, and also setting `openExternalLinks` to true (which requires use of a `QTextBrowser` instead of a `QTextEdit`). I left the full list of flags as `Qt::TextBrowserInteraction` does not include the `TextSelectableByKeyboard` flag (which seems useful here and was included before). I verified that other uses of links work properly via checking all of them found via `git grep href`: * CaptureContext: Uses `QMessageBox` which defers to the style's `SH_MessageBox_TextInteractionFlags` which in practice has at least `Qt::LinksAccessibleByMouse`: * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/plugins/styles/mac/qmacstyle_mac.mm#L2850-L2852 * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/widgets/styles/qcommonstyle.cpp#L5303-L5305 * https://github.com/qt/qtbase/blob/v5.15.11-lts-lgpl/src/widgets/styles/qfusionstyle.cpp#L3702-L3703 * AboutDialog: sets `openExternalLinks` to true on the `version` and `contact` labels in the ui file * AnalyticsConfirmDialog and AnalyticsPromptDialog: uses `on_label_linkActivated` as an automatic slot (as it needs custom handling for opening the documented analytics report) * SettingsDialog: uses `on_analyticsDescribeLabel_linkActivated` as an automatic slot (and only has an internal link for opening the documented analytics report) * CrashDialog: several different ones: * captureFilename works via `on_captureFilename_linkActivated` as an automatic slot (and opens a file in explorer) * reportText has `openExternalLinks` in the ui file * on_send_clicked uses `RDDialog::information` with an email address, which uses `QMessageBox` (see CaptureContext) * finishedText has `openExternalLinks` in the ui file * ExtensionManager: sets `openExternalLinks` to true on the `URL` and `author` labels in the ui file * TipsDialog: sets `openExternalLinks` to true on the `tipUrlLabel` label in the ui file * nv_counter_enumerator.cpp: sets `openExternalLinks` to true on the `counterDescription` label in PerformanceCounterSelection.ui --- qrenderdoc/Widgets/BufferFormatSpecifier.ui | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qrenderdoc/Widgets/BufferFormatSpecifier.ui b/qrenderdoc/Widgets/BufferFormatSpecifier.ui index 5f2e0d937c..796bebed10 100644 --- a/qrenderdoc/Widgets/BufferFormatSpecifier.ui +++ b/qrenderdoc/Widgets/BufferFormatSpecifier.ui @@ -57,7 +57,7 @@ 0 - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> @@ -78,7 +78,10 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;">Annotations are supported for explicit layout, bitpacked types like R10G10B10A2, or alternate displays of values including RGB/hexadecimal/octal display. For a complete list see </span><a href="https://renderdoc.org/docs/how/how_buffer_format.html"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">the documentation linked above</span></a><span style=" font-size:8pt;">.</span></p></body></html> - Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse|Qt::LinksAccessibleByMouse|Qt::LinksAccessibleByKeyboard + + + true