Bug 239116 - webgl2 uniform buffer object size truely support
Summary: webgl2 uniform buffer object size truely support
Status: RESOLVED DUPLICATE of bug 238914
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 15
Hardware: iPhone / iPad iOS 15
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on: 238914
  Show dependency treegraph
Reported: 2022-04-12 01:01 PDT by Gphone
Modified: 2022-06-23 16:34 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Gphone 2022-04-12 01:01:36 PDT
our web product's graphic rendering has upgrade from webgl1 to webgl2.
we follow the Browser compatibility that the safari on IOS version 15 is supported.
but when we finish the work,we found out some problem just on IOS,it is fine on all other platforms based on the Browser compatibility list.
After check and analysis we locate the problem at the Uniform Buffer Object Support.

through the gl.getParameter(GL.XXX) function we have checked many parameters support by the Safari and do not found any problems.
in order to support all devices,our program use the minimun value list in opengles.
when we test the safari,the value is down:

when we define a uniform buffer object ,which size was 16384kb,it can not render any thing,and will cause webgl context lost event later!
then we reduce the ubo's size to 255*vec4=255*16=4080kb,it work fine.and we do not know why is this size.

    'layout(std140) uniform SubjectlBlock',
    '   vec4 datas[255];',

if the ubo's size is lower than 255*vec4,it works fine,but if bigger than 255*vec4,it wll not render any thing.
if the size is not so large,like 300*vec4,it will not log out any thing and no warning(the shader was compiled successfully),just can not see anything.

at first we use many UBOs, then we reduce the UBOs number to one for the test,in the process of this,we found that the total size is shared.
for example,when we have two UBOs,one is 32*vec4 kb,anther is 223*vec4 kb,that's also fine.but the total size can not exceed 255*vec4 kb,otherwise render nothing.

we assume that the webkit transfer UBOs to uniform vectors,so the size is limit by the MAX_VERTEX_UNIFORM_VECTORS and MAX_FRAGMENT_UNIFORM_VECTORS.
but it seems not so right,just a guess.
Comment 1 Kenneth Russell 2022-04-12 11:28:01 PDT
Kyle just posted a fix for this in Bug 238914.

Depending on that bug so others can confirm this is a duplicate.
Comment 2 Gphone 2022-04-12 20:34:58 PDT
(In reply to Kenneth Russell from comment #1)
> Kyle just posted a fix for this in Bug 238914.
> Depending on that bug so others can confirm this is a duplicate.

Comment 3 Radar WebKit Bug Importer 2022-04-19 01:02:12 PDT
Comment 4 Brent Fulgham 2022-06-23 16:34:46 PDT

*** This bug has been marked as a duplicate of bug 238914 ***