mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-11-15 18:31:14 +00:00
Add async tags for display widget painting
* This prevents widget painting from getting out of control and queuing up many redundant paints which slows down processing of the command queue. * Also remove a spammy command to disable pixel context that only ever got called when pixel context was already disabled (right after a reset - at all other times it stays active).
This commit is contained in:
4 files changed
+6
-11
No files matched your search
@@ -33,6 +33,7 @@ CustomPaintWidget::CustomPaintWidget(QWidget *parent) : QWidget(parent)
|
||||
m_Output = NULL;
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
setMouseTracking(true);
|
||||
m_Tag = QFormatStr("custompaint%1").arg((uintptr_t) this);
|
||||
}
|
||||
|
||||
CustomPaintWidget::CustomPaintWidget(ICaptureContext *c, QWidget *parent) : QWidget(parent)
|
||||
@@ -43,6 +44,7 @@ CustomPaintWidget::CustomPaintWidget(ICaptureContext *c, QWidget *parent) : QWid
|
||||
if(c)
|
||||
setAttribute(Qt::WA_PaintOnScreen);
|
||||
setMouseTracking(true);
|
||||
m_Tag = QFormatStr("custompaint%1").arg((uintptr_t) this);
|
||||
}
|
||||
|
||||
CustomPaintWidget::~CustomPaintWidget()
|
||||
@@ -89,7 +91,7 @@ void CustomPaintWidget::paintEvent(QPaintEvent *e)
|
||||
if(m_Ctx)
|
||||
{
|
||||
if(m_Output != NULL)
|
||||
m_Ctx->Replay().AsyncInvoke([this](IReplayController *r) { m_Output->Display(); });
|
||||
m_Ctx->Replay().AsyncInvoke(m_Tag, [this](IReplayController *r) { m_Output->Display(); });
|
||||
}
|
||||
else if(m_Dark == m_Light)
|
||||
{
|
||||
|
||||
@@ -76,6 +76,7 @@ protected:
|
||||
QPaintEngine *paintEngine() const override { return m_Ctx ? NULL : QWidget::paintEngine(); }
|
||||
ICaptureContext *m_Ctx;
|
||||
IReplayOutput *m_Output;
|
||||
QString m_Tag;
|
||||
QColor m_Dark;
|
||||
QColor m_Light;
|
||||
};
|
||||
@@ -2705,8 +2705,9 @@ void BufferViewer::RT_UpdateAndDisplay(IReplayController *)
|
||||
{
|
||||
m_Config.cam = m_CurrentCamera->camera();
|
||||
m_Output->SetMeshDisplay(m_Config);
|
||||
m_Output->Display();
|
||||
}
|
||||
|
||||
GUIInvoke::call([this]() { ui->render->update(); });
|
||||
}
|
||||
|
||||
RDTableView *BufferViewer::tableForStage(MeshDataStage stage)
|
||||
|
||||
@@ -943,19 +943,10 @@ void TextureViewer::UI_UpdateStatusText()
|
||||
|
||||
if(m_TexDisplay.customShaderId != ResourceId())
|
||||
statusText += lit(")");
|
||||
|
||||
// PixelPicked = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
statusText += tr(" - Right click to pick a pixel");
|
||||
|
||||
if(m_Output != NULL)
|
||||
{
|
||||
m_Ctx.Replay().AsyncInvoke([this](IReplayController *) { m_Output->DisablePixelContext(); });
|
||||
}
|
||||
|
||||
// PixelPicked = false;
|
||||
}
|
||||
|
||||
// try and keep status text consistent by sticking to the high water mark
|
||||
|
||||
Reference in new issue
Block a user