mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Add generic user-provided notes to save along with the capture.
* In future one of the notes items would be for gathered hardware info. Not automatically, but with one button press the full configuration can be embedded.
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include <QTimer>
|
||||
#include "Windows/APIInspector.h"
|
||||
#include "Windows/BufferViewer.h"
|
||||
#include "Windows/CommentView.h"
|
||||
#include "Windows/ConstantBufferPreviewer.h"
|
||||
#include "Windows/DebugMessageView.h"
|
||||
#include "Windows/Dialogs/CaptureDialog.h"
|
||||
@@ -131,6 +132,8 @@ void CaptureContext::LoadCapture(const QString &captureFile, const QString &orig
|
||||
{
|
||||
m_LoadInProgress = true;
|
||||
|
||||
bool newCapture = (!temporary && !Config().RecentCaptureFiles.contains(origFilename));
|
||||
|
||||
LambdaThread *thread = new LambdaThread([this, captureFile, origFilename, temporary, local]() {
|
||||
LoadCaptureThreaded(captureFile, origFilename, temporary, local);
|
||||
});
|
||||
@@ -165,6 +168,13 @@ void CaptureContext::LoadCapture(const QString &captureFile, const QString &orig
|
||||
viewer->OnCaptureLoaded();
|
||||
}
|
||||
});
|
||||
|
||||
if(newCapture && m_Notes.contains(lit("comments")))
|
||||
{
|
||||
if(!HasCommentView())
|
||||
ShowCommentView();
|
||||
RaiseDockWindow(GetCommentView()->Widget());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,6 +340,13 @@ void CaptureContext::LoadCaptureThreaded(const QString &captureFile, const QStri
|
||||
bytebuf buf = access->GetSectionContents(idx);
|
||||
LoadBookmarks(QString::fromUtf8((const char *)buf.data(), buf.count()));
|
||||
}
|
||||
|
||||
idx = access->FindSectionByType(SectionType::Notes);
|
||||
if(idx >= 0)
|
||||
{
|
||||
bytebuf buf = access->GetSectionContents(idx);
|
||||
LoadNotes(QString::fromUtf8((const char *)buf.data(), buf.count()));
|
||||
}
|
||||
}
|
||||
|
||||
m_LoadInProgress = false;
|
||||
@@ -633,6 +650,14 @@ bool CaptureContext::SaveCaptureTo(const QString &captureFile)
|
||||
|
||||
Replay().GetCaptureAccess()->WriteSection(props, SaveBookmarks().toUtf8());
|
||||
}
|
||||
if(m_CaptureMods & CaptureModifications::Notes)
|
||||
{
|
||||
SectionProperties props;
|
||||
props.type = SectionType::Notes;
|
||||
props.version = 1;
|
||||
|
||||
Replay().GetCaptureAccess()->WriteSection(props, SaveNotes().toUtf8());
|
||||
}
|
||||
|
||||
m_CaptureMods = CaptureModifications::NoModifications;
|
||||
|
||||
@@ -661,6 +686,7 @@ void CaptureContext::CloseCapture()
|
||||
|
||||
m_CustomNames.clear();
|
||||
m_Bookmarks.clear();
|
||||
m_Notes.clear();
|
||||
|
||||
m_Drawcalls.clear();
|
||||
m_FirstDrawcall = m_LastDrawcall = NULL;
|
||||
@@ -738,6 +764,20 @@ void CaptureContext::AddMessages(const rdcarray<DebugMessage> &msgs)
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureContext::SetNotes(const QString &key, const QString &contents)
|
||||
{
|
||||
// ignore no-op changes
|
||||
if(m_Notes.contains(key) && m_Notes[key] == contents)
|
||||
return;
|
||||
|
||||
m_Notes[key] = contents;
|
||||
|
||||
m_CaptureMods |= CaptureModifications::Notes;
|
||||
m_MainWindow->captureModified();
|
||||
|
||||
RefreshUIStatus({}, true, true);
|
||||
}
|
||||
|
||||
void CaptureContext::SetBookmark(const EventBookmark &mark)
|
||||
{
|
||||
int index = m_Bookmarks.indexOf(mark);
|
||||
@@ -852,6 +892,26 @@ void CaptureContext::LoadBookmarks(const QString &data)
|
||||
}
|
||||
}
|
||||
|
||||
QString CaptureContext::SaveNotes()
|
||||
{
|
||||
QVariantMap root;
|
||||
for(const QString &key : m_Notes.keys())
|
||||
root[key] = m_Notes[key];
|
||||
|
||||
return VariantToJSON(root);
|
||||
}
|
||||
|
||||
void CaptureContext::LoadNotes(const QString &data)
|
||||
{
|
||||
QVariantMap root = JSONToVariant(data);
|
||||
|
||||
for(QString key : root.keys())
|
||||
{
|
||||
if(!key.isEmpty())
|
||||
m_Notes[key] = root[key].toString();
|
||||
}
|
||||
}
|
||||
|
||||
QString CaptureContext::GetResourceName(ResourceId id)
|
||||
{
|
||||
if(id == ResourceId())
|
||||
@@ -1049,6 +1109,18 @@ IDebugMessageView *CaptureContext::GetDebugMessageView()
|
||||
return m_DebugMessageView;
|
||||
}
|
||||
|
||||
ICommentView *CaptureContext::GetCommentView()
|
||||
{
|
||||
if(m_CommentView)
|
||||
return m_CommentView;
|
||||
|
||||
m_CommentView = new CommentView(*this, m_MainWindow);
|
||||
m_CommentView->setObjectName(lit("commentView"));
|
||||
setupDockWindow(m_CommentView);
|
||||
|
||||
return m_CommentView;
|
||||
}
|
||||
|
||||
IPerformanceCounterViewer *CaptureContext::GetPerformanceCounterViewer()
|
||||
{
|
||||
if(m_PerformanceCounterViewer)
|
||||
@@ -1144,6 +1216,11 @@ void CaptureContext::ShowDebugMessageView()
|
||||
m_MainWindow->showDebugMessageView();
|
||||
}
|
||||
|
||||
void CaptureContext::ShowCommentView()
|
||||
{
|
||||
m_MainWindow->showCommentView();
|
||||
}
|
||||
|
||||
void CaptureContext::ShowPerformanceCounterViewer()
|
||||
{
|
||||
m_MainWindow->showPerformanceCounterViewer();
|
||||
@@ -1260,6 +1337,10 @@ QWidget *CaptureContext::CreateBuiltinWindow(const QString &objectName)
|
||||
{
|
||||
return GetDebugMessageView()->Widget();
|
||||
}
|
||||
else if(objectName == lit("commentView"))
|
||||
{
|
||||
return GetCommentView()->Widget();
|
||||
}
|
||||
else if(objectName == lit("statisticsViewer"))
|
||||
{
|
||||
return GetStatisticsViewer()->Widget();
|
||||
@@ -1300,6 +1381,8 @@ void CaptureContext::BuiltinWindowClosed(QWidget *window)
|
||||
m_MeshPreview = NULL;
|
||||
else if(m_DebugMessageView && m_DebugMessageView->Widget() == window)
|
||||
m_DebugMessageView = NULL;
|
||||
else if(m_CommentView && m_CommentView->Widget() == window)
|
||||
m_CommentView = NULL;
|
||||
else if(m_StatisticsViewer && m_StatisticsViewer->Widget() == window)
|
||||
m_StatisticsViewer = NULL;
|
||||
else if(m_TimelineBar && m_TimelineBar->Widget() == window)
|
||||
|
||||
@@ -45,6 +45,7 @@ class BufferViewer;
|
||||
class TextureViewer;
|
||||
class CaptureDialog;
|
||||
class DebugMessageView;
|
||||
class CommentView;
|
||||
class PerformanceCounterViewer;
|
||||
class StatisticsViewer;
|
||||
class TimelineBar;
|
||||
@@ -140,6 +141,8 @@ public:
|
||||
void MarkMessagesRead() override { m_UnreadMessageCount = 0; }
|
||||
void AddMessages(const rdcarray<DebugMessage> &msgs) override;
|
||||
|
||||
QString GetNotes(const QString &key) override { return m_Notes[key]; }
|
||||
void SetNotes(const QString &key, const QString &contents) override;
|
||||
QList<EventBookmark> GetBookmarks() override { return m_Bookmarks; }
|
||||
void SetBookmark(const EventBookmark &mark) override;
|
||||
void RemoveBookmark(uint32_t EID) override;
|
||||
@@ -152,6 +155,7 @@ public:
|
||||
IPipelineStateViewer *GetPipelineViewer() override;
|
||||
ICaptureDialog *GetCaptureDialog() override;
|
||||
IDebugMessageView *GetDebugMessageView() override;
|
||||
ICommentView *GetCommentView() override;
|
||||
IPerformanceCounterViewer *GetPerformanceCounterViewer() override;
|
||||
IStatisticsViewer *GetStatisticsViewer() override;
|
||||
ITimelineBar *GetTimelineBar() override;
|
||||
@@ -165,6 +169,7 @@ public:
|
||||
bool HasMeshPreview() override { return m_MeshPreview != NULL; }
|
||||
bool HasCaptureDialog() override { return m_CaptureDialog != NULL; }
|
||||
bool HasDebugMessageView() override { return m_DebugMessageView != NULL; }
|
||||
bool HasCommentView() override { return m_CommentView != NULL; }
|
||||
bool HasPerformanceCounterViewer() override { return m_PerformanceCounterViewer != NULL; }
|
||||
bool HasStatisticsViewer() override { return m_StatisticsViewer != NULL; }
|
||||
bool HasTimelineBar() override { return m_TimelineBar != NULL; }
|
||||
@@ -177,6 +182,7 @@ public:
|
||||
void ShowPipelineViewer() override;
|
||||
void ShowCaptureDialog() override;
|
||||
void ShowDebugMessageView() override;
|
||||
void ShowCommentView() override;
|
||||
void ShowPerformanceCounterViewer() override;
|
||||
void ShowStatisticsViewer() override;
|
||||
void ShowTimelineBar() override;
|
||||
@@ -253,6 +259,9 @@ private:
|
||||
QString SaveBookmarks();
|
||||
void LoadBookmarks(const QString &data);
|
||||
|
||||
QString SaveNotes();
|
||||
void LoadNotes(const QString &data);
|
||||
|
||||
float m_LoadProgress = 0.0f;
|
||||
float m_PostloadProgress = 0.0f;
|
||||
float UpdateLoadProgress();
|
||||
@@ -299,6 +308,8 @@ private:
|
||||
|
||||
QList<EventBookmark> m_Bookmarks;
|
||||
|
||||
QStringMap m_Notes;
|
||||
|
||||
QMap<ResourceId, QString> m_CustomNames;
|
||||
int m_CustomNameCachedID = 1;
|
||||
|
||||
@@ -325,6 +336,7 @@ private:
|
||||
PipelineStateViewer *m_PipelineViewer = NULL;
|
||||
CaptureDialog *m_CaptureDialog = NULL;
|
||||
DebugMessageView *m_DebugMessageView = NULL;
|
||||
CommentView *m_CommentView = NULL;
|
||||
PerformanceCounterViewer *m_PerformanceCounterViewer = NULL;
|
||||
StatisticsViewer *m_StatisticsViewer = NULL;
|
||||
TimelineBar *m_TimelineBar = NULL;
|
||||
|
||||
@@ -97,6 +97,8 @@ DECLARE_REFLECTION_STRUCT(SPIRVDisassembler);
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_ColorEventRow, true) \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, bool, bool, Comments_ShowOnLoad, false) \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, int, int, Formatter_MinFigures, 2) \
|
||||
\
|
||||
CONFIG_SETTING_VAL(public, int, int, Formatter_MaxFigures, 5) \
|
||||
@@ -313,6 +315,13 @@ For more information about some of these settings that are user-facing see
|
||||
Defaults to ``True``.
|
||||
)",
|
||||
R"(
|
||||
.. data:: Comments_ShowOnLoad
|
||||
|
||||
``True`` if when loading a new capture that contains a comments section, the comment viewer will
|
||||
be opened and focussed.
|
||||
|
||||
Defaults to ``False``.
|
||||
|
||||
.. data:: Formatter_MinFigures
|
||||
|
||||
The minimum number of significant figures to show in formatted floating point values.
|
||||
|
||||
@@ -393,6 +393,22 @@ protected:
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(IDebugMessageView);
|
||||
|
||||
DOCUMENT("The capture comments window.");
|
||||
struct ICommentView
|
||||
{
|
||||
DOCUMENT(
|
||||
"Retrieves the QWidget for this :class:`CommentView` if PySide2 is available, or "
|
||||
"otherwise unique opaque pointer that can be passed to RenderDoc functions expecting a "
|
||||
"QWidget.");
|
||||
virtual QWidget *Widget() = 0;
|
||||
|
||||
protected:
|
||||
ICommentView() = default;
|
||||
~ICommentView() = default;
|
||||
};
|
||||
|
||||
DECLARE_REFLECTION_STRUCT(ICommentView);
|
||||
|
||||
DOCUMENT("The statistics window.");
|
||||
struct IStatisticsViewer
|
||||
{
|
||||
@@ -1296,6 +1312,28 @@ as well as messages generated during replay and analysis.
|
||||
)");
|
||||
virtual void AddMessages(const rdcarray<DebugMessage> &msgs) = 0;
|
||||
|
||||
DOCUMENT(R"(Retrieve the contents for a given notes field.
|
||||
|
||||
Examples of fields are:
|
||||
|
||||
* 'comments' for generic comments to be displayed in a text field
|
||||
* 'hwinfo' for a plaintext summary of the hardware and driver configuration of the system.
|
||||
|
||||
:param str key: The name of the notes field to retrieve.
|
||||
:return: The contents, or an empty string if the field doesn't exist.
|
||||
:rtype: str
|
||||
)");
|
||||
virtual QString GetNotes(const QString &key) = 0;
|
||||
|
||||
DOCUMENT(R"(Set the contents for a given notes field.
|
||||
|
||||
See :meth:`GetNotes` for a list of possible common field keys.
|
||||
|
||||
:param str key: The name of the notes field to set.
|
||||
:param str contents: The new contents to assign to that field.
|
||||
)");
|
||||
virtual void SetNotes(const QString &key, const QString &contents) = 0;
|
||||
|
||||
DOCUMENT(R"(Get the current list of bookmarks in the capture. Each bookmark is associated with an
|
||||
EID and has some text attached. There will only be at most one bookmark for any given EID.
|
||||
|
||||
@@ -1380,6 +1418,13 @@ If no bookmark exists, this function will do nothing.
|
||||
)");
|
||||
virtual IDebugMessageView *GetDebugMessageView() = 0;
|
||||
|
||||
DOCUMENT(R"(Retrieve the current singleton :class:`CommentView`.
|
||||
|
||||
:return: The current window, which is created (but not shown) it there wasn't one open.
|
||||
:rtype: CommentView
|
||||
)");
|
||||
virtual ICommentView *GetCommentView() = 0;
|
||||
|
||||
DOCUMENT(R"(Retrieve the current singleton :class:`PerformanceCounterViewer`.
|
||||
|
||||
:return: The current window, which is created (but not shown) it there wasn't one open.
|
||||
@@ -1464,6 +1509,13 @@ If no bookmark exists, this function will do nothing.
|
||||
)");
|
||||
virtual bool HasDebugMessageView() = 0;
|
||||
|
||||
DOCUMENT(R"(Check if there is a current :class:`CommentView` open.
|
||||
|
||||
:return: ``True`` if there is a window open.
|
||||
:rtype: ``bool``
|
||||
)");
|
||||
virtual bool HasCommentView() = 0;
|
||||
|
||||
DOCUMENT(R"(Check if there is a current :class:`PerformanceCounterViewer` open.
|
||||
|
||||
:return: ``True`` if there is a window open.
|
||||
@@ -1514,6 +1566,8 @@ If no bookmark exists, this function will do nothing.
|
||||
DOCUMENT(
|
||||
"Raise the current :class:`DebugMessageView`, showing it in the default place if needed.");
|
||||
virtual void ShowDebugMessageView() = 0;
|
||||
DOCUMENT("Raise the current :class:`CommentView`, showing it in the default place if needed.");
|
||||
virtual void ShowCommentView() = 0;
|
||||
DOCUMENT(
|
||||
"Raise the current :class:`PerformanceCounterViewer`, showing it in the default place if "
|
||||
"needed.");
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
/******************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 Baldur Karlsson
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#include "CommentView.h"
|
||||
#include <QFontDatabase>
|
||||
#include "3rdparty/scintilla/include/SciLexer.h"
|
||||
#include "3rdparty/scintilla/include/qt/ScintillaEdit.h"
|
||||
#include "ui_CommentView.h"
|
||||
|
||||
CommentView::CommentView(ICaptureContext &ctx, QWidget *parent)
|
||||
: QFrame(parent), ui(new Ui::CommentView), m_Ctx(ctx)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_commentsEditor = new ScintillaEdit(this);
|
||||
|
||||
m_commentsEditor->styleSetFont(
|
||||
STYLE_DEFAULT, QFontDatabase::systemFont(QFontDatabase::FixedFont).family().toUtf8().data());
|
||||
m_commentsEditor->setTabWidth(4);
|
||||
|
||||
QObject::connect(m_commentsEditor, &ScintillaEdit::modified, [this](int type, int, int, int,
|
||||
const QByteArray &, int, int,
|
||||
int) {
|
||||
|
||||
if(m_ignoreModifications)
|
||||
return;
|
||||
|
||||
if(type & (SC_MOD_INSERTTEXT | SC_MOD_DELETETEXT | SC_MOD_BEFOREINSERT | SC_MOD_BEFOREDELETE))
|
||||
{
|
||||
QString text = QString::fromUtf8(m_commentsEditor->getText(m_commentsEditor->textLength() + 1));
|
||||
m_Ctx.SetNotes(lit("comments"), text);
|
||||
}
|
||||
});
|
||||
|
||||
ui->mainLayout->addWidget(m_commentsEditor);
|
||||
|
||||
m_ignoreModifications = true;
|
||||
|
||||
m_Ctx.AddCaptureViewer(this);
|
||||
}
|
||||
|
||||
CommentView::~CommentView()
|
||||
{
|
||||
m_Ctx.BuiltinWindowClosed(this);
|
||||
|
||||
m_Ctx.RemoveCaptureViewer(this);
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void CommentView::OnCaptureClosed()
|
||||
{
|
||||
m_ignoreModifications = true;
|
||||
m_commentsEditor->setText("");
|
||||
m_commentsEditor->emptyUndoBuffer();
|
||||
}
|
||||
|
||||
void CommentView::OnCaptureLoaded()
|
||||
{
|
||||
m_commentsEditor->setText(m_Ctx.GetNotes(lit("comments")).toUtf8().data());
|
||||
m_commentsEditor->emptyUndoBuffer();
|
||||
m_ignoreModifications = false;
|
||||
}
|
||||
|
||||
void CommentView::OnEventChanged(uint32_t eventID)
|
||||
{
|
||||
QString oldText = QString::fromUtf8(m_commentsEditor->getText(m_commentsEditor->textLength() + 1));
|
||||
QString newText = m_Ctx.GetNotes(lit("comments"));
|
||||
|
||||
if(oldText != newText)
|
||||
{
|
||||
bool oldIgnore = m_ignoreModifications;
|
||||
m_ignoreModifications = true;
|
||||
m_commentsEditor->setText(newText.toUtf8().data());
|
||||
m_commentsEditor->emptyUndoBuffer();
|
||||
m_ignoreModifications = oldIgnore;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/******************************************************************************
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2017 Baldur Karlsson
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QFrame>
|
||||
#include "Code/CaptureContext.h"
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
class CommentView;
|
||||
}
|
||||
|
||||
class ScintillaEdit;
|
||||
|
||||
class CommentView : public QFrame, public ICommentView, public ICaptureViewer
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit CommentView(ICaptureContext &ctx, QWidget *parent = 0);
|
||||
~CommentView();
|
||||
|
||||
// ICommentView
|
||||
QWidget *Widget() override { return this; }
|
||||
// ICaptureViewer
|
||||
void OnCaptureLoaded() override;
|
||||
void OnCaptureClosed() override;
|
||||
void OnSelectedEventChanged(uint32_t eventID) override {}
|
||||
void OnEventChanged(uint32_t eventID) override;
|
||||
|
||||
private slots:
|
||||
|
||||
private:
|
||||
Ui::CommentView *ui;
|
||||
ICaptureContext &m_Ctx;
|
||||
|
||||
bool m_ignoreModifications;
|
||||
|
||||
ScintillaEdit *m_commentsEditor;
|
||||
};
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>CommentView</class>
|
||||
<widget class="QFrame" name="CommentView">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Capture Comments</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="mainLayout">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>3</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -10,6 +10,9 @@
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Debug warnings and errors</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<property name="leftMargin">
|
||||
<number>3</number>
|
||||
|
||||
@@ -106,6 +106,8 @@ SettingsDialog::SettingsDialog(ICaptureContext &ctx, QWidget *parent)
|
||||
// disable sub-checkbox
|
||||
ui->EventBrowser_ColorEventRow->setEnabled(ui->EventBrowser_ApplyColors->isChecked());
|
||||
|
||||
ui->Comments_ShowOnLoad->setChecked(m_Ctx.Config().Comments_ShowOnLoad);
|
||||
|
||||
ui->Formatter_MinFigures->setValue(m_Ctx.Config().Formatter_MinFigures);
|
||||
ui->Formatter_MaxFigures->setValue(m_Ctx.Config().Formatter_MaxFigures);
|
||||
ui->Formatter_NegExp->setValue(m_Ctx.Config().Formatter_NegExp);
|
||||
@@ -359,6 +361,13 @@ void SettingsDialog::on_EventBrowser_ColorEventRow_toggled(bool checked)
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
void SettingsDialog::on_Comments_ShowOnLoad_toggled(bool checked)
|
||||
{
|
||||
m_Ctx.Config().Comments_ShowOnLoad = ui->Comments_ShowOnLoad->isChecked();
|
||||
|
||||
m_Ctx.Config().Save();
|
||||
}
|
||||
|
||||
// android
|
||||
void SettingsDialog::on_browseTempCaptureDirectory_clicked()
|
||||
{
|
||||
|
||||
@@ -82,6 +82,9 @@ private slots:
|
||||
void on_EventBrowser_ApplyColors_toggled(bool checked);
|
||||
void on_EventBrowser_ColorEventRow_toggled(bool checked);
|
||||
|
||||
// comments
|
||||
void on_Comments_ShowOnLoad_toggled(bool checked);
|
||||
|
||||
// android
|
||||
void on_browseTempCaptureDirectory_clicked();
|
||||
void on_browseAdbPath_clicked();
|
||||
|
||||
@@ -868,6 +868,77 @@ If {spv_disas} is not used, the tool is expected to output the disassembly on st
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="commentsTab">
|
||||
<attribute name="title">
|
||||
<string>Comments</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_8">
|
||||
<property name="title">
|
||||
<string>Capture Comments</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_9">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_32">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>When loading a capture with comments in it, show the comments viewer and focus it when the capture is loaded.
|
||||
|
||||
Only happens if the capture is not in the recent files list.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Show capture comments on load</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="Comments_ShowOnLoad">
|
||||
<property name="toolTip">
|
||||
<string>When loading a capture with comments in it, show the comments viewer and focus it when the capture is loaded.
|
||||
|
||||
Only happens if the capture is not in the recent files list.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<spacer name="verticalSpacer_7">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>297</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="androidTab">
|
||||
<attribute name="title">
|
||||
<string>Android</string>
|
||||
|
||||
@@ -1552,6 +1552,16 @@ void MainWindow::on_action_Errors_and_Warnings_triggered()
|
||||
ui->toolWindowManager->addToolWindow(debugMessages, mainToolArea());
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Comments_triggered()
|
||||
{
|
||||
QWidget *comments = m_Ctx.GetCommentView()->Widget();
|
||||
|
||||
if(ui->toolWindowManager->toolWindows().contains(comments))
|
||||
ToolWindowManager::raiseToolWindow(comments);
|
||||
else
|
||||
ui->toolWindowManager->addToolWindow(comments, mainToolArea());
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Statistics_Viewer_triggered()
|
||||
{
|
||||
QWidget *stats = m_Ctx.GetStatisticsViewer()->Widget();
|
||||
|
||||
@@ -90,6 +90,7 @@ public:
|
||||
void showPipelineViewer() { on_action_Pipeline_State_triggered(); }
|
||||
void showCaptureDialog() { on_action_Launch_Application_triggered(); }
|
||||
void showDebugMessageView() { on_action_Errors_and_Warnings_triggered(); }
|
||||
void showCommentView() { on_action_Comments_triggered(); }
|
||||
void showStatisticsViewer() { on_action_Statistics_Viewer_triggered(); }
|
||||
void showTimelineBar() { on_action_Timeline_triggered(); }
|
||||
void showPythonShell() { on_action_Python_Shell_triggered(); }
|
||||
@@ -112,6 +113,7 @@ private slots:
|
||||
void on_action_Pipeline_State_triggered();
|
||||
void on_action_Launch_Application_triggered();
|
||||
void on_action_Errors_and_Warnings_triggered();
|
||||
void on_action_Comments_triggered();
|
||||
void on_action_Statistics_Viewer_triggered();
|
||||
void on_action_Timeline_triggered();
|
||||
void on_action_Python_Shell_triggered();
|
||||
|
||||
@@ -133,6 +133,7 @@
|
||||
<addaction name="action_Statistics_Viewer"/>
|
||||
<addaction name="action_Counter_Viewer"/>
|
||||
<addaction name="action_Resource_Inspector"/>
|
||||
<addaction name="action_Comments"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menu_Help">
|
||||
<property name="title">
|
||||
@@ -418,6 +419,11 @@
|
||||
<string>Sa&ve Capture As</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="action_Comments">
|
||||
<property name="text">
|
||||
<string>Capture C&omments</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
||||
@@ -111,6 +111,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
virtual const QVector<DebugMessage> &DebugMessages() override { return m_Ctx.DebugMessages(); }
|
||||
virtual int UnreadMessageCount() override { return m_Ctx.UnreadMessageCount(); }
|
||||
virtual void MarkMessagesRead() override { return m_Ctx.MarkMessagesRead(); }
|
||||
virtual QString GetNotes(const QString &key) override { return m_Ctx.GetNotes(key); }
|
||||
virtual QList<EventBookmark> GetBookmarks() override { return m_Ctx.GetBookmarks(); }
|
||||
virtual const D3D11Pipe::State &CurD3D11PipelineState() override
|
||||
{
|
||||
@@ -191,6 +192,10 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetResourceCustomName, id, name);
|
||||
}
|
||||
virtual void SetNotes(const QString &key, const QString &contents) override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::SetNotes, key, contents);
|
||||
}
|
||||
|
||||
virtual void SetBookmark(const EventBookmark &mark) override
|
||||
{
|
||||
@@ -232,6 +237,10 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
return InvokeRetFunction<IDebugMessageView *>(&ICaptureContext::GetDebugMessageView);
|
||||
}
|
||||
virtual ICommentView *GetCommentView() override
|
||||
{
|
||||
return InvokeRetFunction<ICommentView *>(&ICaptureContext::GetCommentView);
|
||||
}
|
||||
virtual IPerformanceCounterViewer *GetPerformanceCounterViewer() override
|
||||
{
|
||||
return InvokeRetFunction<IPerformanceCounterViewer *>(
|
||||
@@ -281,6 +290,10 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
return InvokeRetFunction<bool>(&ICaptureContext::HasDebugMessageView);
|
||||
}
|
||||
virtual bool HasCommentView() override
|
||||
{
|
||||
return InvokeRetFunction<bool>(&ICaptureContext::HasCommentView);
|
||||
}
|
||||
virtual bool HasPerformanceCounterViewer() override
|
||||
{
|
||||
return InvokeRetFunction<bool>(&ICaptureContext::HasPerformanceCounterViewer);
|
||||
@@ -327,6 +340,7 @@ struct CaptureContextInvoker : ICaptureContext
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::ShowDebugMessageView);
|
||||
}
|
||||
virtual void ShowCommentView() override { InvokeVoidFunction(&ICaptureContext::ShowCommentView); }
|
||||
virtual void ShowPerformanceCounterViewer() override
|
||||
{
|
||||
InvokeVoidFunction(&ICaptureContext::ShowPerformanceCounterViewer);
|
||||
|
||||
@@ -202,6 +202,7 @@ SOURCES += Code/qrenderdoc.cpp \
|
||||
Windows/BufferViewer.cpp \
|
||||
Widgets/Extended/RDTableView.cpp \
|
||||
Windows/DebugMessageView.cpp \
|
||||
Windows/CommentView.cpp \
|
||||
Windows/StatisticsViewer.cpp \
|
||||
Windows/TimelineBar.cpp \
|
||||
Windows/Dialogs/SettingsDialog.cpp \
|
||||
@@ -269,6 +270,7 @@ HEADERS += Code/CaptureContext.h \
|
||||
Windows/BufferViewer.h \
|
||||
Widgets/Extended/RDTableView.h \
|
||||
Windows/DebugMessageView.h \
|
||||
Windows/CommentView.h \
|
||||
Windows/StatisticsViewer.h \
|
||||
Windows/TimelineBar.h \
|
||||
Windows/Dialogs/SettingsDialog.h \
|
||||
@@ -307,6 +309,7 @@ FORMS += Windows/Dialogs/AboutDialog.ui \
|
||||
Windows/BufferViewer.ui \
|
||||
Windows/ShaderViewer.ui \
|
||||
Windows/DebugMessageView.ui \
|
||||
Windows/CommentView.ui \
|
||||
Windows/StatisticsViewer.ui \
|
||||
Windows/Dialogs/SettingsDialog.ui \
|
||||
Windows/Dialogs/OrderedListEditor.ui \
|
||||
|
||||
@@ -587,6 +587,7 @@
|
||||
<ClCompile Include="$(IntDir)generated\moc_D3D11PipelineStateViewer.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_D3D12PipelineStateViewer.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_DebugMessageView.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_CommentView.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_EventBrowser.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_GLPipelineStateViewer.cpp" />
|
||||
<ClCompile Include="$(IntDir)generated\moc_LiveCapture.cpp" />
|
||||
@@ -682,6 +683,7 @@
|
||||
<ClCompile Include="Windows\BufferViewer.cpp" />
|
||||
<ClCompile Include="Windows\ConstantBufferPreviewer.cpp" />
|
||||
<ClCompile Include="Windows\DebugMessageView.cpp" />
|
||||
<ClCompile Include="Windows\CommentView.cpp" />
|
||||
<ClCompile Include="Windows\Dialogs\AboutDialog.cpp" />
|
||||
<ClCompile Include="Windows\Dialogs\CaptureDialog.cpp" />
|
||||
<ClCompile Include="Windows\Dialogs\LiveCapture.cpp" />
|
||||
@@ -887,6 +889,7 @@
|
||||
<ClInclude Include="$(IntDir)generated\ui_D3D11PipelineStateViewer.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_D3D12PipelineStateViewer.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_DebugMessageView.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_CommentView.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_EventBrowser.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_GLPipelineStateViewer.h" />
|
||||
<ClInclude Include="$(IntDir)generated\ui_LiveCapture.h" />
|
||||
@@ -1096,6 +1099,12 @@
|
||||
<Message>MOC %(Filename).h</Message>
|
||||
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\CommentView.h">
|
||||
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp"</Command>
|
||||
<Message>MOC %(Filename).h</Message>
|
||||
<Outputs>$(IntDir)generated\moc_%(Filename).cpp</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\Dialogs\AboutDialog.h">
|
||||
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\moc.exe" -DUNICODE -DWIN32 -DWIN64 -D_WIN32 -D_WIN64 -DRENDERDOC_PLATFORM_WIN32 -DSCINTILLA_QT=1 -DSCI_LEXER=1 -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -D_MSC_VER=1900 -I"$(ProjectDir)." -I"$(SolutionDir)\renderdoc\api\replay" -I"$(ProjectDir)3rdparty\qt\$(Platform)\mkspecs/win32-msvc2015" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtWidgets" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtGui" -I"$(ProjectDir)3rdparty\qt\$(Platform)\include\QtCore" "%(Fullpath)" -o "$(IntDir)generated\moc_%(Filename).cpp"</Command>
|
||||
@@ -1318,6 +1327,12 @@
|
||||
<Message>UIC %(Filename).ui</Message>
|
||||
<Outputs>$(IntDir)generated\ui_%(Filename).h</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\CommentView.ui">
|
||||
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe" "%(Fullpath)" -o "$(IntDir)generated\ui_%(Filename).h"</Command>
|
||||
<Message>UIC %(Filename).ui</Message>
|
||||
<Outputs>$(IntDir)generated\ui_%(Filename).h</Outputs>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\Dialogs\AboutDialog.ui">
|
||||
<AdditionalInputs>%(Fullpath);$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe;%(AdditionalInputs)</AdditionalInputs>
|
||||
<Command>"$(ProjectDir)3rdparty\qt\$(Platform)\bin\uic.exe" "%(Fullpath)" -o "$(IntDir)generated\ui_%(Filename).h"</Command>
|
||||
|
||||
@@ -375,6 +375,9 @@
|
||||
<ClCompile Include="Windows\DebugMessageView.cpp">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Windows\CommentView.cpp">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Windows\StatisticsViewer.cpp">
|
||||
<Filter>Windows</Filter>
|
||||
</ClCompile>
|
||||
@@ -423,6 +426,9 @@
|
||||
<ClCompile Include="$(IntDir)generated\moc_DebugMessageView.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(IntDir)generated\moc_CommentView.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="$(IntDir)generated\moc_EventBrowser.cpp">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClCompile>
|
||||
@@ -893,6 +899,9 @@
|
||||
<ClInclude Include="$(IntDir)generated\ui_DebugMessageView.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(IntDir)generated\ui_CommentView.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="$(IntDir)generated\ui_EnvironmentEditor.h">
|
||||
<Filter>Generated Files</Filter>
|
||||
</ClInclude>
|
||||
@@ -1226,6 +1235,9 @@
|
||||
<CustomBuild Include="Windows\DebugMessageView.ui">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\CommentView.ui">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\EventBrowser.ui">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
@@ -1313,6 +1325,9 @@
|
||||
<CustomBuild Include="Windows\DebugMessageView.h">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\CommentView.h">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
<CustomBuild Include="Windows\EventBrowser.h">
|
||||
<Filter>Windows</Filter>
|
||||
</CustomBuild>
|
||||
|
||||
Reference in New Issue
Block a user