Skip to content

Handle WebGL context loss #8200

Description

@aglitchman

Is your feature request related to a problem? Please describe (REQUIRED):
WebGL context can be lost when not enough GPU resources are available.

Describe the solution you'd like (REQUIRED):
I don't know how the game can restore it, or if it should. But at the very least, it should have a handler for this error. Because in the logs of the error reporting system I see indirect errors that there is no WebGL context and consequently players see a frozen game:

  • TypeError: Argument 1 ('shader') to WebGL2RenderingContext.shaderSource must be an instance of WebGLShader
  • TypeError: Failed to execute 'getAttribLocation' on 'WebGL2RenderingContext': parameter 1 is not of type 'WebGLProgram'
  • TypeError: WebGLRenderingContext.shaderSource: Argument 1 is not an object.

etc.

Describe alternatives you've considered (REQUIRED):
No alternatives.

Additional context (OPTIONAL):
https://www.khronos.org/webgl/wiki/HandlingContextLost

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

engineIssues related to the Defold enginefeature requestA suggestion for a new featurehtml5Issue related to the HTML5 platformrender

Type

No type

Fields

Priority

5

Size

3

Score

8.333333333333334

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions