Closed Bug 869703 Opened 6 years ago Closed 6 years ago

WebGL failure retrieving uniform

Categories

(Core :: Canvas: WebGL, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: ra.vitillo, Assigned: ra.vitillo)

Details

Attachments

(2 files, 2 obsolete files)

Attached file testcase
The attached test generates the following error (v. 20.0.1):

Warning: Error: WebGL: UniformMatrix2fv: this function expected a uniform of element size 4, got a uniform of element size 0
Source File: file:///home/vitillo/sandbox/webgl/Tut04/test.html
Line: 33

The issue seems to be that an uniform info is retrieved only on demand by reading the information from the attached shaders. If the program has been successfully linked and the shaders detached then the search will fail. Nevertheless the operation should succeed even if the shaders have been detached after linking.
Attached patch Patch with a possible solution. (obsolete) — Splinter Review
Comment on attachment 746674 [details] [diff] [review]
Patch with a possible solution.

Review of attachment 746674 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good, but we should add this assert.

::: content/canvas/src/WebGLProgram.cpp
@@ -224,4 @@
>  
>  WebGLUniformInfo
>  WebGLProgram::GetUniformInfoForMappedIdentifier(const nsACString& name) {
> -    if (!mUniformInfoMap) {

Assert that mUniformInfoMap is present.
Attachment #746674 - Flags: review+
Status: UNCONFIRMED → NEW
Ever confirmed: true
Great analysis and patch! Thanks!
Forgot to check this in?
Flags: needinfo?(ra.vitillo)
Indeed, please make a version of the patch with a commit message

   Bug xxx - what the patch actually does - r=jgilbert

and flag the patch with 'checkin?'
Attached patch patch (obsolete) — Splinter Review
Attachment #746674 - Attachment is obsolete: true
Attachment #757583 - Flags: checkin?
Flags: needinfo?(ra.vitillo)
Attachment #757583 - Flags: checkin?
Attached patch patchSplinter Review
Attachment #757583 - Attachment is obsolete: true
Attachment #758183 - Flags: checkin?
Attachment #758183 - Flags: checkin? → checkin+
https://hg.mozilla.org/integration/mozilla-inbound/rev/5443b4e12cda

Thanks for the patch, Roberto! :)
Assignee: nobody → ra.vitillo
https://hg.mozilla.org/mozilla-central/rev/5443b4e12cda
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.