RESOLVED DUPLICATE of bug 238914 Bug 239116
webgl2 uniform buffer object size truely support
https://bugs.webkit.org/show_bug.cgi?id=239116
Summary webgl2 uniform buffer object size truely support
Gphone
Reported 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: MAX_UNIFORM_BLOCK_SIZE = 16384kb MAX_UNIFORM_BUFFER_BINDINGS = 24 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];', '}Subject;', 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.
Attachments
Kenneth Russell
Comment 1 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.
Gphone
Comment 2 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. ok.thanks
Radar WebKit Bug Importer
Comment 3 2022-04-19 01:02:12 PDT
Brent Fulgham
Comment 4 2022-06-23 16:34:46 PDT
*** This bug has been marked as a duplicate of bug 238914 ***
Note You need to log in before you can comment on or make changes to this bug.