mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 15:55:36 +00:00
Bug 1492580 - Limit glGetError flush loop and handle CONTEXT_LOST. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D11270 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
c803ccff25
commit
ba222f72b8
@ -2058,6 +2058,30 @@ GLContext::MarkDestroyed()
|
||||
mSymbols = {};
|
||||
}
|
||||
|
||||
// -
|
||||
|
||||
GLenum
|
||||
GLContext::RawGetErrorAndClear() const
|
||||
{
|
||||
const GLenum ret = mSymbols.fGetError();
|
||||
|
||||
auto flushedErr = ret;
|
||||
uint32_t i = 1;
|
||||
while (flushedErr && flushedErr != LOCAL_GL_CONTEXT_LOST) {
|
||||
if (i == 100) {
|
||||
gfxCriticalError() << "Flushing glGetError still " << gfx::hexa(flushedErr)
|
||||
<< " after " << i << " calls.";
|
||||
break;
|
||||
}
|
||||
flushedErr = mSymbols.fGetError();
|
||||
i += 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// -
|
||||
|
||||
#ifdef MOZ_GL_DEBUG
|
||||
/* static */ void
|
||||
GLContext::AssertNotPassingStackBufferToTheGL(const void* ptr)
|
||||
|
@ -579,18 +579,7 @@ public:
|
||||
private:
|
||||
mutable GLenum mTopError = 0;
|
||||
|
||||
GLenum RawGetError() const {
|
||||
return mSymbols.fGetError();
|
||||
}
|
||||
|
||||
GLenum RawGetErrorAndClear() const {
|
||||
GLenum err = RawGetError();
|
||||
|
||||
if (err)
|
||||
while (RawGetError()) {}
|
||||
|
||||
return err;
|
||||
}
|
||||
GLenum RawGetErrorAndClear() const;
|
||||
|
||||
GLenum FlushErrors() const {
|
||||
GLenum err = RawGetErrorAndClear();
|
||||
|
Loading…
Reference in New Issue
Block a user