mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-23 22:25:55 +00:00
Recreate proxy preview window if it's out of date
This commit is contained in:
@@ -1860,13 +1860,29 @@ const DrawcallDescription *ReplayProxy::FindDraw(const rdcarray<DrawcallDescript
|
||||
|
||||
void ReplayProxy::InitPreviewWindow()
|
||||
{
|
||||
if(m_Replay && m_PreviewWindow && m_PreviewOutput == 0)
|
||||
if(m_Replay && m_PreviewWindow)
|
||||
{
|
||||
WindowingData data = m_PreviewWindow(true, m_Replay->GetSupportedWindowSystems());
|
||||
if(data.system != WindowingSystem::Unknown)
|
||||
m_PreviewOutput = m_Replay->MakeOutputWindow(data, false);
|
||||
|
||||
m_FrameRecord = m_Replay->GetFrameRecord();
|
||||
if(data.system != WindowingSystem::Unknown)
|
||||
{
|
||||
// if the data has changed, destroy the old window so we'll recreate
|
||||
if(m_PreviewWindow == 0 || memcmp(&m_PreviewWindowingData, &data, sizeof(data)))
|
||||
{
|
||||
if(m_PreviewWindow)
|
||||
{
|
||||
RDCDEBUG("Re-creating preview window due to change in data");
|
||||
m_Replay->DestroyOutputWindow(m_PreviewOutput);
|
||||
}
|
||||
|
||||
m_PreviewOutput = m_Replay->MakeOutputWindow(data, false);
|
||||
|
||||
m_PreviewWindowingData = data;
|
||||
}
|
||||
}
|
||||
|
||||
if(m_FrameRecord.drawcallList.empty())
|
||||
m_FrameRecord = m_Replay->GetFrameRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -634,6 +634,8 @@ private:
|
||||
// the ID of the output window to use for previewing on the remote host. Only valid/useful if
|
||||
// m_Replay is set
|
||||
uint64_t m_PreviewOutput = 0;
|
||||
// The previous windowing data, so we can detect changes and recreate the window
|
||||
WindowingData m_PreviewWindowingData;
|
||||
|
||||
uint32_t m_PreviewEvent = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user