[webkit-dev] WebGlRendering Context Restored and Lost

Dean Jackson dino at apple.com
Fri Feb 21 11:44:22 PST 2014


Hi Rakesh,

On 21 Feb 2014, at 2:18 pm, Rakesh Sadhu <rakeshsadhu at hotmail.com> wrote:

> I have a question, When a glcontext is lost and again restored , what should be the behaviour of associated extensions ?

When a ContextLost occurs on a WebGLRenderingContext all extensions should be reset, as described by the specification (with the exception of the special extension that can manually trigger a ContextLost). This doesn’t necessarily mean the values get NULLed (since you may have an existing reference), just that they will fire exceptions if you use them.

I have an in-progress pull request on a test case for this, on the Khronos github repository.

BTW - this question is probably best suited to the WebGL mailing lists, unless you think there is a WebKit bug.

Dean

> I have a test case  http://www.khronos.org/registry/webgl/sdk/tests/conformance/context/context-lost-restored.html,
> and in it I am confused to see  that upon context restoration , test case expects extension 's related API's to be NULL .
> 
> here is the  js code snippet from above mentioned link:
> 
> 
> function testOESVertexArrayObject() {
>   if (OES_vertex_array_object) {
>     // Extension must still be lost.
>     shouldBeNull("OES_vertex_array_object.createVertexArrayOES()");  // WHY ????
>     // Try re-enabling extension
> 
>     old_OES_vertex_array_object = OES_vertex_array_object;
>     OES_vertex_array_object = reGetExtensionAndTestForProperty(gl, "OES_vertex_array_object", false);
>     shouldBeTrue("OES_vertex_array_object.createVertexArrayOES() != null");
>     shouldBeTrue("old_OES_vertex_array_object.createVertexArrayOES() == null");
>   }
> }
> 
> function testExtensions() {
>   testOESTextureFloat();
>   testOESVertexArrayObject();
>   // Only the WEBGL_lose_context extension should be the same object after context lost.
>   new_WEBGL_lose_context = reGetExtensionAndTestForProperty(gl, "WEBGL_lose_context", true);
> }
> 
> 
> ///  this function is a callback function , which is attached to addeventlistener in above mention link//
> 
> function testRestoredContext()
> {
>     debug("Test restored context");
>     shouldBeFalse("contextRestoredEventFired");
>     contextRestoredEventFired = true;
>     shouldBeFalse("gl.isContextLost()");
>     shouldBe("gl.getError()", "gl.NO_ERROR");
> 
>     // Validate that using old resources fails.
>     testResources(gl.INVALID_OPERATION);
> 
>     testRendering();
> 
>     // Validate new resources created in testRendering().
>     testResources(gl.NO_ERROR);
> 
>     testExtensions();
> 
>     debug("");
> }
> 
> Our Webkit Nightly Build  fails 
>     shouldBeNull("OES_vertex_array_object.createVertexArrayOES()")
> which it should fail , however khronous test case suite expects it to PASS , adn i tested this on chrome on windows, that passes :(
> 
> 
> Kindly put some light here..
> regards
> rsadhu
> 
> 
> regards
> RSadhu
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20140222/ce96bbbb/attachment.html>


More information about the webkit-dev mailing list