WebGL oldest context will be lost: What is the expected behavior?

Viewed 127

Based on the warning provided, I expected browsers to drop context's in the order they were created.

However I did a test in Chrome where I create 16 contexts asynchronously (delay 200 ms between their creation). The first 10 are constantly redrawing something, while the last 6 make 1 draw call and then stop.

When I created the 17th context (this is when the error starts generating) all 10 of the 'constantly updating' contexts continued drawing. However when I tried to draw on the 6 'paused' contexts, it seems 1 of them failed to make any further draw calls.

From the best I can tell the context I couldn't get working again is the one that dropped, despite being created at a later date.

Is this expected behavior, or how do browsers decide which context to terminate?

1 Answers

There's no official spec regarding the order in which contexts should be dropped, developers are expected to bind to the webglcontexlost event and / or check the result of gl.isContextLost().

Related