Bug 38707 - uniform* entry points must ignore the call if a null WebGLUniformLocation is passed
Summary: uniform* entry points must ignore the call if a null WebGLUniformLocation is ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-06 17:37 PDT by Kenneth Russell
Modified: 2010-06-11 07:50 PDT (History)
4 users (show)

See Also:


Attachments
patch (21.96 KB, patch)
2010-06-09 18:17 PDT, Zhenyao Mo
no flags Details | Formatted Diff | Diff
revised patch (21.97 KB, patch)
2010-06-10 17:41 PDT, Zhenyao Mo
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kenneth Russell 2010-05-06 17:37:57 PDT
Per a recent WebGL spec update motivated by Gregg Tavares, passing a null WebGLUniformLocation to the uniform* entry points should cause the call to be silently ignored rather than generating an OpenGL error. This is the behavior of the underlying OpenGL implementation when a -1 location is passed to glUniform*, and is motivated by application frameworks which look up a bunch of uniforms, where some might not exist in a particular program or might have been optimized away by the GLSL compiler.
Comment 1 Zhenyao Mo 2010-06-09 18:17:01 PDT
Created attachment 58319 [details]
patch
Comment 2 Kenneth Russell 2010-06-10 17:14:22 PDT
Comment on attachment 58319 [details]
patch

Looks good. One minor comment about one of the tests.

LayoutTests/fast/canvas/webgl/script-tests/uniform-location.js:23
 +  shouldBeUndefined("contextA.uniformMatrix4fv(0, false, mat)");
For correctness we should change this to "contextA.uniformMatrix4fv(null, false, mat)".
Comment 3 Zhenyao Mo 2010-06-10 17:41:37 PDT
Created attachment 58424 [details]
revised patch

Changed 0 to null in the test.
Comment 4 Kenneth Russell 2010-06-10 17:48:20 PDT
Comment on attachment 58424 [details]
revised patch

Looks good.
Comment 5 Dimitri Glazkov (Google) 2010-06-10 21:38:16 PDT
Comment on attachment 58424 [details]
revised patch

Energize.
Comment 6 WebKit Commit Bot 2010-06-11 07:50:40 PDT
Comment on attachment 58424 [details]
revised patch

Clearing flags on attachment: 58424

Committed r61018: <http://trac.webkit.org/changeset/61018>
Comment 7 WebKit Commit Bot 2010-06-11 07:50:45 PDT
All reviewed patches have been landed.  Closing bug.