Closed Bug 1279766 Opened 8 years ago Closed 6 years ago

WebGL2 reporting incorrect uniforms

Categories

(Core :: Graphics: CanvasWebGL, defect, P3)

50 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mozilla2, Assigned: jgilbert)

References

()

Details

(Keywords: nightly-community, Whiteboard: [gfx-noted])

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36 Steps to reproduce: go to http://twgljs.org/examples/uniform-buffer-objects.html Actual results: The cubes are black Expected results: The cubes are colored and lit If I go into the library where it's looking up uniforms it loops over all the uniforms to get their locations. If I print out the names of the uniforms it found this it what it says getting location for: u_diffuse getting location for: Lights.u_lightWorldPos getting location for: Lights.u_lightColor getting location for: u_ambient getting location for: u_specular getting location for: u_shininess getting location for: u_specularFactor getting location for: u_viewInverse getting location for: u_viewProjection As far as I can tell these 2 are wrong getting location for: Lights.u_lightWorldPos getting location for: Lights.u_lightColor They should be 4 uniforms not 2 and should be Lights[0].u_lightWorldPos Lights[0].u_LightColor Lights[1].u_lightWorldPos Lights[1].u_LightColor Similarly if I print out the uniform block object names I get uniform block name: 0 Lights uniform block name: 1 Lights uniform block name: 2 Model uniform block name: 3 Material uniform block name: 4 View As far as I can tell there should only be one block named "Lights" Are there conformance tests for these features that are known not to pass yet? Of course it's also possible there's something wrong with my program PS: I'm on a Early 2015 Macbook Pro. OSX 10.11.5, NVIDIA GeForce GT 750M and I'm running FirefoxNightly 50.0a1 (2016-06-11)
Summary: WebGL2 uniform remapping leaking back into JavaScript → WebGL2 reporting incorrect uniforms
Hmmm, so checking Chrome I see maybe the first diagnosis was slightly off. The uniforms are correct, it's the blocks only that are wrong. Chrome returns the same uniforms but it also returns uniform block name: 0 Lights[0] // different from firefox uniform block name: 1 Lights[1] // different from firefox uniform block name: 2 Model uniform block name: 3 Material uniform block name: 4 View I gotta assume Chrome is correct here? If the names between block 0 and block 1 are not different then there would be no way to call `gl.getUniformBlockIndex(program, blockName)` since the names would not be unique.
Thanks Gregg, I can't reproduce your bug on a Linux Nightly, NeedInfo-ed Nical, he may know who to CC on this WebGL bug report.
It's me. I'll take a look.
Component: Untriaged → Canvas: WebGL
Assignee: nobody → jgilbert
Blocks: webgl2
Whiteboard: [gfx-noted]
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true

Please reopen if this still reproduces for you!

Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WORKSFORME

(WFM: Late-2013 15" MBP on NV dGPU)

You need to log in before you can comment on or make changes to this bug.