diff --git a/qrenderdoc/Code/Interface/PersistantConfig.h b/qrenderdoc/Code/Interface/PersistantConfig.h index 22fae0edd..ebed727c2 100644 --- a/qrenderdoc/Code/Interface/PersistantConfig.h +++ b/qrenderdoc/Code/Interface/PersistantConfig.h @@ -308,6 +308,8 @@ DECLARE_REFLECTION_STRUCT(BugReport); \ CONFIG_SETTING_VAL(public, int, int, LocalProxyAPI, -1) \ \ + CONFIG_SETTING_VAL(public, bool, bool, BufferFormatter_ShowHelp, true) \ + \ CONFIG_SETTING_VAL(public, int, TimeUnit, EventBrowser_TimeUnit, TimeUnit::Microseconds) \ \ CONFIG_SETTING_VAL(public, bool, bool, EventBrowser_AddFake, true) \ @@ -551,6 +553,12 @@ For more information about some of these settings that are user-facing see Defaults to ``-1``. +.. data:: BufferFormatter_ShowHelp + + ``True`` if the buffer formatter's help section should be shown. + + Defaults to ``True``. + .. data:: EventBrowser_TimeUnit The :class:`TimeUnit` to use to display the duration column in the :class:`EventBrowser`. diff --git a/qrenderdoc/Widgets/BufferFormatSpecifier.cpp b/qrenderdoc/Widgets/BufferFormatSpecifier.cpp index a8c6d914e..6121f7d2a 100644 --- a/qrenderdoc/Widgets/BufferFormatSpecifier.cpp +++ b/qrenderdoc/Widgets/BufferFormatSpecifier.cpp @@ -41,9 +41,17 @@ BufferFormatSpecifier::BufferFormatSpecifier(QWidget *parent) BufferFormatSpecifier::~BufferFormatSpecifier() { + if(m_Ctx) + m_Ctx->Config().BufferFormatter_ShowHelp = ui->helpText->isVisible(); delete ui; } +void BufferFormatSpecifier::setContext(ICaptureContext *ctx) +{ + m_Ctx = ctx; + showHelp(m_Ctx->Config().BufferFormatter_ShowHelp); +} + void BufferFormatSpecifier::toggleHelp() { ui->helpText->setVisible(!ui->helpText->isVisible()); diff --git a/qrenderdoc/Widgets/BufferFormatSpecifier.h b/qrenderdoc/Widgets/BufferFormatSpecifier.h index ae660854a..abdfcd809 100644 --- a/qrenderdoc/Widgets/BufferFormatSpecifier.h +++ b/qrenderdoc/Widgets/BufferFormatSpecifier.h @@ -26,6 +26,8 @@ #include +struct ICaptureContext; + namespace Ui { class BufferFormatSpecifier; @@ -39,6 +41,8 @@ public: explicit BufferFormatSpecifier(QWidget *parent = 0); ~BufferFormatSpecifier(); + void setContext(ICaptureContext *ctx); + signals: void processFormat(const QString &format); @@ -53,4 +57,5 @@ private slots: private: Ui::BufferFormatSpecifier *ui; + ICaptureContext *m_Ctx; }; diff --git a/qrenderdoc/Widgets/BufferFormatSpecifier.ui b/qrenderdoc/Widgets/BufferFormatSpecifier.ui index fe8296432..5df1e84f8 100644 --- a/qrenderdoc/Widgets/BufferFormatSpecifier.ui +++ b/qrenderdoc/Widgets/BufferFormatSpecifier.ui @@ -75,7 +75,10 @@ - Type in a buffer format declaration, including struct definitions. Comments and {} braces are skipped, : semantics are ignored. + Type in a buffer format declaration. C and C++ comments are skipped, semantics are ignored. + +Structs can be defined and nested, and if no variables are 'loose' the last struct specified will be used. + Declare each element as an hlsl/glsl variable, e.g: "float4 first; float2 second; uint2 third;" or vec4/vec2. Basic types accepted: bool, byte, short, int, half, float, double. diff --git a/qrenderdoc/Windows/BufferViewer.cpp b/qrenderdoc/Windows/BufferViewer.cpp index 058aa96c3..d7898cb12 100644 --- a/qrenderdoc/Windows/BufferViewer.cpp +++ b/qrenderdoc/Windows/BufferViewer.cpp @@ -1730,6 +1730,8 @@ BufferViewer::BufferViewer(ICaptureContext &ctx, bool meshview, QWidget *parent) m_MeshView = meshview; + ui->formatSpecifier->setContext(&m_Ctx); + m_Flycam = new FlycamWrapper(); m_Arcball = new ArcballWrapper(); m_CurrentCamera = m_Arcball; diff --git a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp index 7e2f21fe5..238e881d5 100644 --- a/qrenderdoc/Windows/ConstantBufferPreviewer.cpp +++ b/qrenderdoc/Windows/ConstantBufferPreviewer.cpp @@ -43,7 +43,7 @@ ConstantBufferPreviewer::ConstantBufferPreviewer(ICaptureContext &ctx, const Sha QObject::connect(ui->formatSpecifier, &BufferFormatSpecifier::processFormat, this, &ConstantBufferPreviewer::processFormat); - ui->formatSpecifier->showHelp(false); + ui->formatSpecifier->setContext(&m_Ctx); ui->splitter->setCollapsible(1, true); ui->splitter->setSizes({1, 0});