Calling gl.uniform3fv with undefined uniform location causes unexpected errors
Categories
(Core :: Graphics: CanvasWebGL, defect, P1)
Tracking
()
People
(Reporter: sergey.ext, Assigned: jgilbert)
References
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:76.0) Gecko/20100101 Firefox/76.0
Steps to reproduce:
Open this page with Firefox 75.0 or 76.0:
https://sergeyext.github.io/sergeyext/firefox_gluniform3fv_test.html
Then open console (F12)
Actual results:
There are two errors in console:
-
WebGL warning: uniform setter:
values
length (4) must be a positive integer multiple of size of <enum 0x8b51>. -
GL error state is set to GL_INVALID_VALUE.
Expected results:
Should be no errors.
Some renderers control their shader features with shader source modification and/or glsl preprocessor macros. Such shader design can cause some uniforms to be optimized out. In this case getUniformLocation returns null, and it should be perfectly OK to pass null or undefined to uniform setter functions. It is similar to passing -1 as uniform location in GL ES3, in which case the passed in values are silently ignored.
When passing null or undefined to glUniform3fv in FF 75 or 76, it warns that array length should be multiple of sizeof<enum 0x8b51> (i.e. sizeof vec3, 12 bytes), which is completely irrelevant, as the same call with valid uniform location object does not have such requirement.
Also, gl error state is set to GL_INVALID_VALUE, which seems to be irrelevant too, as in ES3 this error is only generated when count is less than 0.
Tested on Windows 10 and Linux x64 with Intel 630 and Nvidia GTX950M GPUs.
Firefox 73.0 didn't have this issue.
Comment 2•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 3•5 years ago
|
||
The severity field is not set for this bug.
:jgilbert, could you have a look please?
For more information, please visit auto_nag documentation.
Assignee | ||
Updated•5 years ago
|
Comment 4•5 years ago
|
||
Hi,
I was able to replicate the issue on windows 10 pro, on nightly 82.0a1 (2020-08-27) (64-bit) , beta 81.0b2, and release 80.0 (64-bit)
I'll update the bug's status accordingly.
Best,
Clara
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 5•5 years ago
|
||
Also:
- Propagate null-location UniformDatas to host
- Move transpose validation to host-side
Comment 7•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Updated•5 years ago
|
Comment 8•5 years ago
|
||
Reproduced the initial errors using old Nightly from 2020-08-28, verified that no errors are shown in console using Firefox 85.0b3 across platforms (Windows 10 64bit, macOS 11 and Ubuntu 18.04).
Description
•