The default bug view has changed. See this FAQ.

WebGL failure retrieving uniform

RESOLVED FIXED in mozilla24

Status

()

Core
Canvas: WebGL
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Roberto Agostino Vitillo, Assigned: Roberto Agostino Vitillo)

Tracking

unspecified
mozilla24
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

4 years ago
Created attachment 746672 [details]
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.
(Assignee)

Comment 1

4 years ago
Created attachment 746674 [details] [diff] [review]
Patch with a possible solution.
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?'
(Assignee)

Comment 6

4 years ago
Created attachment 757583 [details] [diff] [review]
patch
Attachment #746674 - Attachment is obsolete: true
Attachment #757583 - Flags: checkin?
Flags: needinfo?(ra.vitillo)
Keywords: checkin-needed
Attachment #757583 - Flags: checkin?
This patch doesn't apply. Please make sure it was generated per the directions below.
https://developer.mozilla.org/en-US/docs/Mercurial_FAQ#How_can_I_generate_a_patch_for_somebody_else_to_check-in_for_me.3F
Keywords: checkin-needed
(Assignee)

Comment 8

4 years ago
Created attachment 758183 [details] [diff] [review]
patch
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.