Treat API as unsupported if no frame capturers handle it. Closes #2222

* This is a bit coarse, as e.g. if you have one window that is unsupported on an
  API and another that is this will treat both as supported even if the active
  window doesn't support capturing. This is an unlikely case and needs a new UI
  to properly represent that.
This commit is contained in:
baldurk
2021-04-14 16:56:14 +01:00
parent eac94b74f6
commit 5b52bd7724
4 changed files with 20 additions and 2 deletions
+13
View File
@@ -1914,6 +1914,19 @@ void RenderDoc::RemoveFrameCapturer(void *dev, void *wnd)
}
}
bool RenderDoc::HasActiveFrameCapturer(RDCDriver driver) const
{
for(auto cap = m_WindowFrameCapturers.begin(); cap != m_WindowFrameCapturers.end(); cap++)
if(cap->second.FrameCapturer->GetFrameCaptureDriver() == driver)
return true;
for(auto cap = m_DeviceFrameCapturers.begin(); cap != m_DeviceFrameCapturers.end(); cap++)
if(cap->second->GetFrameCaptureDriver() == driver)
return true;
return false;
}
#if ENABLED(ENABLE_UNIT_TESTS)
#undef None
+1
View File
@@ -525,6 +525,7 @@ public:
void AddFrameCapturer(void *dev, void *wnd, IFrameCapturer *cap);
void RemoveFrameCapturer(void *dev, void *wnd);
bool HasActiveFrameCapturer(RDCDriver driver) const;
// add window-less frame capturers for use via users capturing
// manually through the renderdoc API with NULL device/window handles
+2
View File
@@ -196,6 +196,8 @@ void RenderDoc::TargetControlClientThread(uint32_t version, Network::Socket *cli
bool supported =
RenderDoc::Inst().HasRemoteDriver(driver) || RenderDoc::Inst().HasReplayDriver(driver);
supported &= RenderDoc::Inst().HasActiveFrameCapturer(driver);
WRITE_DATA_SCOPE();
{
SCOPED_SERIALISE_CHUNK(ePacket_APIUse);
+4 -2
View File
@@ -1030,7 +1030,8 @@ void WrappedOpenGL::DeleteContext(void *contextHandle)
RDCLOG("Deleting context %p", contextHandle);
RenderDoc::Inst().RemoveDeviceFrameCapturer(ctxdata.ctx);
if(ctxdata.Modern())
RenderDoc::Inst().RemoveDeviceFrameCapturer(ctxdata.ctx);
// delete the context
GetResourceManager()->DeleteContext(contextHandle);
@@ -1161,7 +1162,8 @@ void WrappedOpenGL::CreateContext(GLWindowingData winData, void *shareContext,
RDCLOG("Reusing old sharegroup %p", ctxdata.shareGroup);
}
RenderDoc::Inst().AddDeviceFrameCapturer(ctxdata.ctx, this);
if(ctxdata.Modern())
RenderDoc::Inst().AddDeviceFrameCapturer(ctxdata.ctx, this);
// re-configure callstack capture, since WrappedOpenGL constructor may run too early
uint32_t flags = m_ScratchSerialiser.GetChunkMetadataRecording();