mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Add a UI panel to ShaderViewer to show the shader debug loading log
A button toggles the logging panel open/closed
This commit is contained in:
@@ -455,6 +455,9 @@ void ShaderViewer::editShader(ResourceId id, ShaderStage stage, const QString &e
|
||||
ui->inputSig->hide();
|
||||
ui->outputSig->hide();
|
||||
|
||||
// hide debug info logging
|
||||
ui->toggleLog->hide();
|
||||
|
||||
QString title;
|
||||
|
||||
QWidget *sel = NULL;
|
||||
@@ -6627,6 +6630,38 @@ void ShaderViewer::on_debugToggle_clicked()
|
||||
updateDebugState();
|
||||
}
|
||||
|
||||
void ShaderViewer::on_toggleLog_clicked()
|
||||
{
|
||||
if(m_Scintillas.isEmpty())
|
||||
return;
|
||||
|
||||
if(debugInfoLog)
|
||||
{
|
||||
ui->docking->removeToolWindow(debugInfoLog);
|
||||
debugInfoLog = NULL;
|
||||
return;
|
||||
}
|
||||
|
||||
debugInfoLog = new QTextEdit(this);
|
||||
debugInfoLog->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
|
||||
debugInfoLog->setWindowTitle(tr("Debug Info Loading Logging"));
|
||||
debugInfoLog->setFont(Formatter::FixedFont());
|
||||
|
||||
QString qText;
|
||||
if(m_ShaderDetails && !m_ShaderDetails->debugInfo.debugInfoLoadingLog.empty())
|
||||
qText = m_ShaderDetails->debugInfo.debugInfoLoadingLog;
|
||||
else
|
||||
qText = QString::fromUtf8("Debug info loading logging is not available for this shader");
|
||||
|
||||
debugInfoLog->setText(qText);
|
||||
|
||||
ui->docking->addToolWindow(
|
||||
debugInfoLog, ToolWindowManager::AreaReference(ToolWindowManager::AddTo,
|
||||
ui->docking->areaOf(m_Scintillas.back())));
|
||||
ui->docking->setToolWindowProperties(
|
||||
debugInfoLog, ToolWindowManager::HideCloseButton | ToolWindowManager::DisallowFloatWindow);
|
||||
}
|
||||
|
||||
void ShaderViewer::on_resources_sortByStep_clicked()
|
||||
{
|
||||
m_AccessedResourceView = AccessedResourceView::SortByStep;
|
||||
|
||||
@@ -44,6 +44,7 @@ class QTableWidgetItem;
|
||||
class QKeyEvent;
|
||||
class QMouseEvent;
|
||||
class QComboBox;
|
||||
class QTextEdit;
|
||||
|
||||
// from Scintilla
|
||||
typedef intptr_t sptr_t;
|
||||
@@ -189,6 +190,7 @@ private slots:
|
||||
void on_intView_clicked();
|
||||
void on_floatView_clicked();
|
||||
void on_debugToggle_clicked();
|
||||
void on_toggleLog_clicked();
|
||||
|
||||
void on_resources_sortByStep_clicked();
|
||||
void on_resources_sortByResource_clicked();
|
||||
@@ -358,6 +360,8 @@ private:
|
||||
static const int BOOKMARK_MAX_MENU_ENTRY_COUNT = 30; // max number of bookmarks listed in menu
|
||||
QMap<ScintillaEdit *, QList<sptr_t>> m_Bookmarks;
|
||||
|
||||
QTextEdit *debugInfoLog = NULL;
|
||||
|
||||
static const int CURRENT_MARKER = 0;
|
||||
static const int BREAKPOINT_MARKER = 2;
|
||||
static const int FINISHED_MARKER = 4;
|
||||
|
||||
@@ -299,6 +299,23 @@
|
||||
<property name="bottomMargin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="toggleLog">
|
||||
<property name="toolTip">
|
||||
<string>Show/Hide Debug Info Logging Panel</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../Resources/resources.qrc">
|
||||
<normaloff>:/information.png</normaloff>:/information.png</iconset>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextBesideIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="findReplace">
|
||||
<property name="toolTip">
|
||||
|
||||
Reference in New Issue
Block a user