[Bug 106881] glUniform4fv does not work
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Mon Jun 11 10:57:47 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=106881
Bug ID: 106881
Summary: glUniform4fv does not work
Product: Mesa
Version: git
Hardware: x86-64 (AMD64)
OS: Linux (All)
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/DRI/i965
Assignee: intel-3d-bugs at lists.freedesktop.org
Reporter: xinghua.cao at intel.com
QA Contact: intel-3d-bugs at lists.freedesktop.org
Steps:
1. Download chrome and install it on your Ubuntu,
https://www.google.com/chrome/?platform=linux&extra=devchannel;
2. Open chrome on command line, "google-chrome-unstable --use-gl=egl
--user-data-dir=./caghe_local_debug";(If cannot reproduce this issue again,
please rm caghe_local_debug in current directory, chrome has cache mechanism)
3. Open the link,
https://www.khronos.org/registry/webgl/sdk/tests/conformance/programs/program-test.html?webglVersion=2&quiet=0
4. one case fails.
Notes:
1. This case was reproduced by our QA team, but I could only reproduce it on
mesa git master, could not reproduce on system driver(Ubuntu 17.10). May our
latest code introduced some regression?
2. This case only tests "Program's uniforms should be cleared when re-linking
program successfully". You can check
https://www.khronos.org/registry/OpenGL-Refpages/es3.0/ , there is more
information about "glUniform", Quate a number of sentences,
"All active uniform variables defined in a program object are initialized to 0
when the program object is linked successfully. They retain the values assigned
to them by a call to glUniform until the next successful link operation occurs
on the program object, when they are once again initialized to 0."
3. This case code is very simple,
Shader code:
VS:
attribute highp vec4 webgl_613687ebc2d92685;
void main(){
(gl_Position = vec4(0.0, 0.0, 0.0, 0.0));
(gl_Position = webgl_613687ebc2d92685);
}
FS:
uniform mediump vec4 webgl_8463902250c1a4db;
void main(){
(gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0));
(gl_FragColor = webgl_8463902250c1a4db);
}
API code:
var prg = wtu.setupProgram(gl, ["vshader", "fshader-settable"],
["a_position"]); //This statemenet includes shader compile, program link and
use program APIs
var colorLoc = gl.getUniformLocation(prg, "u_color");
gl.uniform4f(colorLoc, 1, 0, 0, 1);
wtu.clearAndDrawUnitQuad(gl);
wtu.checkCanvas(gl, [255, 0, 0, 255], "should be red");
gl.linkProgram(prg);
// Program's uniforms should be cleared at this point without calling
useProgram
wtu.clearAndDrawUnitQuad(gl, [0, 255, 0, 255]);
wtu.checkCanvas(gl, [0, 0, 0, 0], "should be tranparent black"); // Error
happened here, [0, 0, 0, 0] color was expected, but got [255, 0, 0, 255], it
seemed that uniform in FS shader was not modified.
wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors");
According spec, when calling "gl.linkProgram(prg)", all uniforms will be
again initialized to 0.
4. Because these shaders were not changed, linkProgram had no effect here for
some implementations. What is the behavior for this situation?
In order to avoid depending on implementations to again initialize uniforms
to 0, chrome does not call glLinkProgram again for "gl.linkProgram(prg)"
statement, it explicitly calls "glUniform4fv" to clear this uniform, but the
case still fail on mesa, seems that glUniform4fv does not work.
--
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20180611/affb5dcb/attachment.html>
More information about the intel-3d-bugs
mailing list