Closed Bug 571076 Opened 12 years ago Closed 12 years ago
Should return a JS array of (nsI)WebGLShader.
Patch; note that no existing conformance test covers this function at all. So the only thing that I checked, is that it compiles. Should learn some JS...
Sounds like I shouldn't review this until you create and add a test! :-)
Here's a patch against the program-test.html test, making it test getAttachedShaders. Do you think 1) it's enough testing and 2) that this test change would be OK to commit to khronos.org?
Nope, not nearly enough testing (also space after "if"); this should test at least -- - getting attached shaders with a program with no shaders (empty list) - with a few shaders attached - removing a shader, then checking the list - removing all shaders, ensuring list is empty - maybe adding some shaders whose compilation purposely fails, and checking that they still exist in the list
This new version fixes an issue discovered while testing (see next comment): GetAttachedShaders was returning null object instead of empty list. It also fixes an issue in LinkProgram: when the program doesn't have both shader types attached, the result was INVALID_OPERATION, but according to the OpenGL ES documentation, this shouldn't generate any GL error, it should simply let the program in a failed link status.
This patch expands a lot the program-test. It allowed to catch the 2 issues mentioned in the previous comment.
Comment on attachment 451078 [details] [diff] [review] Expand the WebGL program test Looks good, though a style comment on the tests.. right now the tests create a new program for each check and validate each step along the way. That's probably fine, but it would also be ok (and maybe easier to follow) if you just used one program, attaching/detaching shaders along the way and validating that the set of attached shaders is consistent after each step. Up to you which way you want to keep it, though.
Attachment #451078 - Flags: review?(vladimir) → review+
12 years ago
Attachment #451077 - Flags: review?(vladimir) → review+
My fear is that, since we store state in WebGLProgram, reusing a WebGLProgram object may lead to different behavior (if we have a bug). So I felt more comfortable creating a new WebGLProgram everytime. Is that reasonable?
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.