[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] possible non-passable test: program-test.html requires program state to be left untouched by a failed link



Hi,

Kudos to Eric Anholt on the mesa-dev list for finding this.

program-test.html contains this:

    gl.attachShader(progGood2, fsBad);
    gl.linkProgram(progGood2);
    assertMsg(gl.getProgramParameter(progGood2, gl.LINK_STATUS) == false,
              "linking should fail with in-use formerly good program, with new bad shader attached");

    // Invalid link leaves previous valid program intact.
    gl.drawArrays(gl.TRIANGLES, 0, 3);
    glErrorShouldBe(gl, gl.NO_ERROR, "drawing with a valid program shouldn't generate a GL error");

As the comment says, this requires a WebGL implementation to keep programs intact after a failed link. 

The WebGL spec doesn't seem to say anything specific about that, and the OpenGL ES 2.0.25 spec, page 30, says:

"If LinkProgram failed, any information about a previous link of that program object is lost. Thus, a failed link does not restore the old state of program."

Thus, this test seems incorrect.

OK to fix it by enforcing the above-quoted behavior from the GLES2 spec? This should be easy to implement in WebGL implementations in a way that doesn't depend on drivers.

Cheers,
Benoit

-----------------------------------------------------------
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl
-----------------------------------------------------------