Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Starred by 12 users
Status: Fixed
Closed: May 2012
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

  • Only users with EditIssue permission may comment.

Sign in to add a comment
clear all uniforms on successful linkProgram
Project Member Reported by, Apr 24 2012 Back to list
Certain drivers do not set default uniform values correctly. According to the OpenGL ES 2.0 spec, they should all default to zero.

So, add code to the command buffer to call glUniformXXX for each uniform on a successful link

Comment 1 by, Apr 26 2012
This is not as easy as it sounds. The problem is in order to call glUniformXXX you need to call glUseProgram. But, if the user called glUseProgram on a good program, then relinked that program and the link fail, the good program is still in use but calling glUseProgram with the user's bad linked program will fail.

3 solutions come to mind

1) double buffer programs so we can call glUseProgram on the last good one

2) Use a "special" service side only context. We can call glUseProgram on that context and not effect the user's context

3) Instead of setting all the uniforms to 0 after a successful link, set any unset uniforms to 0 just before drawing. Might also need to set them on query if they have not been set.

Comment 2 by, Apr 26 2012
It's too bad that GLES's semantics around re-linking a previously good program with a bad one are so complicated, but I like (3) the best because it doesn't involve creation of another context. The appeal of (2) is that it would still allow the work to be done at successful link time. (1) seems complicated and undesirable.

Comment 3 by, Apr 26 2012
You can also initializing all uniforms in useProgram (if it's not initialized already)

You also need to cache all uniform() calls and only truly call them in useProgram, and uniform query always return the cached values.
Comment 4 by, Apr 26 2012
doing it on useProgram sounds like the easiest place.

I'm not sure why you'd need to cache calls. 

I think you can clear them all on linkProgram if that program is the current program and clear them on useProgram if they are not already cleared.
Comment 6 by, May 1 2012
Status: Fixed
Project Member Comment 7 by, Oct 13 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 8 by, Mar 10 2013
Labels: -Area-Internals -Mstone-21 -Feature-GPU-Internals Cr-Internals-GPU-Internals M-21 Cr-Internals
Project Member Comment 9 by, Mar 14 2013
Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Sign in to add a comment