Closed Bug 1922497 Opened 1 year ago Closed 1 year ago

Firefox WebGL-OpenGL incorrectly ignore limit of MAX_FRAGMENT_UNIFORM_COMPONENTS

Categories

(Core :: Graphics: CanvasWebGL, defect)

Firefox 130
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: s48gs.w, Unassigned)

References

Details

Attachments

(1 file)

Attached image screenshot.png

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:130.0) Gecko/20100101 Firefox/130.0

Steps to reproduce:

This is only Firefox 130

  1. Firefox 130 in OpenGL
  2. https://www.shadertoy.com/new
float [1024] arr;
void mainImage( out vec4 c, in vec2 fc )
{
    for(int i=0;i<arr.length();i++){arr[i]=fc.x/iResolution.x+float(i)/float(arr.length());}
    c = vec4(arr[int(fc.x)%arr.length()]);
}
  1. Press Compile on Shadertoy page:
Unknown Error: ERROR: 0:? : '' : Total size of declared private variables exceeds implementation-defined limit

MAX_FRAGMENT_UNIFORM_COMPONENTS
On shadertoy website:

console.log(document.getElementById("demogl").getContext("webgl2").getParameter(document.getElementById("demogl").getContext("webgl2").MAX_FRAGMENT_UNIFORM_COMPONENTS));

Return 4096 on Nvidia and 16384 on AMD - much more than 1024.

This code work on Chrome on same PC in OpenGL - and on new Firefox 132.0b2 - this is not "GPU drivers bug".

https://registry.khronos.org/webgl/specs/latest/2.0/#refsGLES30GLSL

Many functions described in this document contain links to OpenGL ES man pages. While every effort is made to make these pages match the OpenGL ES 3.0 specification [GLES30], they may contain errors. In the case of a contradiction, the OpenGL ES 3.0 specification is the final authority.

GLES30 page:
https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf

3.9. FRAGMENT SHADERS 166
uniform block is specified by the value of the implementation-dependent constant MAX_FRAGMENT_UNIFORM_COMPONENTS. The implementation-dependent constant MAX_FRAGMENT_UNIFORM_VECTORS has a value equal to the value of MAX_FRAGMENT_UNIFORM_COMPONENTS divided by four. The total amount of combined storage available for fragment shader uniform variables in all uniform blocks (including the default uniform block) is specified by the value of the implementation-dependent constant MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS.

It does not limit const-size to 1024.

Actual results:

This is only Firefox 130.
I tested 132.0b2 - no this bug - but im not sure if there will be no bug on release.
Before I used Firefox 128 - there also no this bug.

Reason for this bug I think - Firefox 130 limit number of shader constants to 1024.

Expected results:

No shader compile error.

The Bugbug bot thinks this bug should belong to the 'Core::Graphics: CanvasWebGL' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Graphics: CanvasWebGL
Product: Firefox → Core
Flags: needinfo?(jgilbert)

MAX_FRAGMENT_UNIFORM_COMPONENTS is for uniform variables. Your variable in this case has no attribute/varying/uniform/input/output label, so therefore is "private".
Our "working as intended" label is INVALID, so I'm resolving this bug as INVALID.

However, bug 1912404 removed the 1024 limit for Mesa anyway, so your testcase should work again in Firefox 132, which I believe is currently Beta.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Flags: needinfo?(jgilbert)
Resolution: --- → INVALID
See Also: → 1912404
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: