mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-26 08:26:50 +00:00
Print a logfile error if we regularly see SwapBuffers() with no context
This commit is contained in:
@@ -720,6 +720,7 @@ WrappedOpenGL::WrappedOpenGL(const char *logfile, const GLHookSet &funcs) : m_Re
|
||||
m_Replay.SetDriver(this);
|
||||
|
||||
m_FrameCounter = 0;
|
||||
m_NoCtxFrames = 0;
|
||||
m_FailedFrame = 0;
|
||||
m_FailedReason = CaptureSucceeded;
|
||||
m_Failures = 0;
|
||||
@@ -2227,7 +2228,20 @@ void WrappedOpenGL::SwapBuffers(void *windowHandle)
|
||||
|
||||
// don't do anything if no context is active.
|
||||
if(GetCtx() == NULL)
|
||||
{
|
||||
m_NoCtxFrames++;
|
||||
if(m_NoCtxFrames == 100)
|
||||
{
|
||||
RDCERR(
|
||||
"Seen 100 frames with no context current. RenderDoc requires a context to be current "
|
||||
"during the call to SwapBuffers to display its overlay and start/stop captures on "
|
||||
"default keys.\nIf your GL use is elsewhere, consider using the in-application API to "
|
||||
"trigger captures manually");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
m_NoCtxFrames = 0;
|
||||
|
||||
m_FrameCounter++; // first present becomes frame #1, this function is at the end of the frame
|
||||
|
||||
|
||||
@@ -186,6 +186,7 @@ private:
|
||||
GLResourceManager *m_ResourceManager;
|
||||
|
||||
uint32_t m_FrameCounter;
|
||||
uint32_t m_NoCtxFrames;
|
||||
uint32_t m_FailedFrame;
|
||||
CaptureFailReason m_FailedReason;
|
||||
uint32_t m_Failures;
|
||||
|
||||
Reference in New Issue
Block a user