Bug 34508 - getUniform will not work for fetching uniform array elements
Summary: getUniform will not work for fetching uniform array elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P4 Minor
Assignee: Zhenyao Mo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-02 18:21 PST by Kenneth Russell
Modified: 2010-06-25 21:53 PDT (History)
6 users (show)

See Also:


Attachments
patch (32.38 KB, patch)
2010-06-24 17:55 PDT, Zhenyao Mo
no flags Details | Formatted Diff | Diff
revised patch: fix style issues (32.07 KB, patch)
2010-06-24 18:26 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-02-02 18:21:26 PST
From code inspection, the implementation of getUniform will not work properly when fetching an element of a uniform array. The code needs to check the size of the WebGLActiveInfo coming back from getActiveUniform and, if it is greater than 1, iterate from 0 to that size, generating names like "foo[0]", "foo[1]", etc. to pass back in to getUniformLocation.
Comment 1 Zhenyao Mo 2010-06-24 17:55:06 PDT
Created attachment 59714 [details]
patch

The gl-uniform-array.html test is copied from WebGL conformance tests.

Have to fix some minor bugs to make the test green:
1) For a few functions, generate INVALID_OPERATION (instead of INVALID_VALUE) if resource is from another context.
2) useProgram(null) should work in Safari.

Tested both Chromium and Safari in Mac.
Comment 2 WebKit Review Bot 2010-06-24 17:57:37 PDT
Attachment 59714 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/html/canvas/WebGLRenderingContext.cpp:1558:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
WebCore/html/canvas/WebGLRenderingContext.cpp:1566:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
WebCore/html/canvas/WebGLRenderingContext.cpp:1574:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 3 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Zhenyao Mo 2010-06-24 18:26:52 PDT
Created attachment 59718 [details]
revised patch: fix style issues
Comment 4 Kenneth Russell 2010-06-25 17:23:28 PDT
Comment on attachment 59718 [details]
revised patch: fix style issues

Looks good to me. It isn't obvious to me that the incorrect-context-object-behaviour test changes are directly related to the code changes, so perhaps they should be split into a different bug, but in my opinion this isn't that big a deal.
Comment 5 Dimitri Glazkov (Google) 2010-06-25 19:56:05 PDT
Comment on attachment 59718 [details]
revised patch: fix style issues

ok.
Comment 6 WebKit Commit Bot 2010-06-25 21:53:36 PDT
Comment on attachment 59718 [details]
revised patch: fix style issues

Clearing flags on attachment: 59718

Committed r61939: <http://trac.webkit.org/changeset/61939>
Comment 7 WebKit Commit Bot 2010-06-25 21:53:41 PDT
All reviewed patches have been landed.  Closing bug.