Restore lost context before using it; fixes #2958
Looks like since we call loseContext() on `WebGLRenderer#destroy()` that
if you create another WebGLRenderer with the same canvas the browser will
recycle that lost context and return it.

This means when we try to use the context it is actually in a lost state.
This change tries to restore a lost context before we use it. It also adds
a debug assert at one location that will be invalid if the context is
invalid.
1 parent ba36360 commit fb7b78cc7814b8a6d2f4831a48f582a11411daa2
@Chad Engler Chad Engler authored on 4 Oct 2016
Showing 2 changed files
View
src/core/renderers/webgl/WebGLRenderer.js
View
src/core/renderers/webgl/utils/checkMaxIfStatmentsInShader.js