mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Show usage in timeline bar when selecting/focussing resource inspector
This commit is contained in:
@@ -372,6 +372,8 @@ void ResourceInspector::resource_doubleClicked(const QModelIndex &index)
|
||||
{
|
||||
ResourceId id = index.model()->data(index, ResourceIdRole).value<ResourceId>();
|
||||
Inspect(id);
|
||||
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void ResourceInspector::on_viewContents_clicked()
|
||||
@@ -432,3 +434,19 @@ void ResourceInspector::on_resourceUsage_doubleClicked(const QModelIndex &index)
|
||||
uint32_t eid = index.model()->data(index, ResourceIdRole).value<uint32_t>();
|
||||
m_Ctx.SetEventID({}, eid, eid);
|
||||
}
|
||||
|
||||
void ResourceInspector::enterEvent(QEvent *event)
|
||||
{
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void ResourceInspector::showEvent(QShowEvent *event)
|
||||
{
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void ResourceInspector::HighlightUsage()
|
||||
{
|
||||
if(m_Resource != ResourceId() && m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightResourceUsage(m_Resource);
|
||||
}
|
||||
|
||||
@@ -68,10 +68,15 @@ public slots:
|
||||
|
||||
private slots:
|
||||
void on_viewContents_clicked();
|
||||
|
||||
void on_resourceUsage_doubleClicked(const QModelIndex &index);
|
||||
|
||||
protected:
|
||||
void enterEvent(QEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private:
|
||||
void HighlightUsage();
|
||||
|
||||
Ui::ResourceInspector *ui;
|
||||
ICaptureContext &m_Ctx;
|
||||
|
||||
|
||||
@@ -662,6 +662,24 @@ TextureViewer::~TextureViewer()
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void TextureViewer::enterEvent(QEvent *event)
|
||||
{
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void TextureViewer::showEvent(QShowEvent *event)
|
||||
{
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void TextureViewer::HighlightUsage()
|
||||
{
|
||||
TextureDescription *texptr = GetCurrentTexture();
|
||||
|
||||
if(texptr && m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->resourceId);
|
||||
}
|
||||
|
||||
void TextureViewer::RT_FetchCurrentPixel(uint32_t x, uint32_t y, PixelValue &pickValue,
|
||||
PixelValue &realValue)
|
||||
{
|
||||
@@ -1327,8 +1345,7 @@ void TextureViewer::UI_OnTextureSelectionChanged(bool newdraw)
|
||||
RT_PickPixelsAndUpdate(r);
|
||||
});
|
||||
|
||||
if(m_Ctx.HasTimelineBar())
|
||||
m_Ctx.GetTimelineBar()->HighlightResourceUsage(texptr->resourceId);
|
||||
HighlightUsage();
|
||||
}
|
||||
|
||||
void TextureViewer::UI_SetHistogramRange(const TextureDescription *tex, CompType typeHint)
|
||||
|
||||
@@ -206,6 +206,10 @@ private slots:
|
||||
void channelsWidget_mouseClicked(QMouseEvent *event);
|
||||
void channelsWidget_toggled(bool checked) { UI_UpdateChannels(); }
|
||||
void channelsWidget_selected(int index) { UI_UpdateChannels(); }
|
||||
protected:
|
||||
void enterEvent(QEvent *event) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
|
||||
private:
|
||||
void RT_FetchCurrentPixel(uint32_t x, uint32_t y, PixelValue &pickValue, PixelValue &realValue);
|
||||
void RT_PickPixelsAndUpdate(IReplayController *);
|
||||
@@ -223,6 +227,8 @@ private:
|
||||
|
||||
void UI_UpdateChannels();
|
||||
|
||||
void HighlightUsage();
|
||||
|
||||
void SetupTextureTabs();
|
||||
|
||||
void Reset();
|
||||
|
||||
Reference in New Issue
Block a user