WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
246335
'flat' vertex shader output is extremely slow with 'WebGL via Metal'
https://bugs.webkit.org/show_bug.cgi?id=246335
Summary
'flat' vertex shader output is extremely slow with 'WebGL via Metal'
Marcin
Reported
2022-10-11 06:01:12 PDT
Declaring vertex shader output with 'flat' specifier makes drawing very slow. It is not suffering from it when drawing POINTS primitive. Also, problem does not occur when WebGL via Metal is disabled. in vec2 clip_space_pos; in vec4 just_color; flat out vec4 flat_color; void main() { gl_Position = vec4(clip_space_pos,0.0,1.0); flat_color = just_color * clip_space_pos.x; }
Attachments
Add attachment
proposed patch, testcase, etc.
Kimmo Kinnunen
Comment 1
2022-10-11 12:10:20 PDT
Thanks for filing. This is one other area where Metal has to emulate: the provoking vertex is different in Metal than it is in OpenGL. At the moment the emulation is likely not the fastest. If you are using drawElements, you may find drawArrays faster. However, this will still suffer a perf penalty. We're also working on a provoking vertex extension in case your shader does not depend on the provoking vertex. See:
https://github.com/KhronosGroup/WebGL/issues/3401
This extension is available in current WebKit trunk builds (e.g. in minibrowser) under experimental features, experimental WebGL extensions. If you try out the provoking vertex extension, please provide feedback in both cases: if you find it does not improve or improves perf.
Marcin
Comment 2
2022-10-12 02:29:10 PDT
Having EXT_provoking_vertex extension would be great, but I don't see it on my iPhone Safari settings and getExtension("EXT_provoking_vertex") returns null. Hopefully with next OS update I can use it. Regarding performance of drawElements and drawArrays, I have actually opposite experience, drawElements is significantly faster. Anyway thanks for the info, I was able to work around need for flat varyings, and now Metal backend seams to outperform the older thing.
Radar WebKit Bug Importer
Comment 3
2022-10-18 06:02:25 PDT
<
rdar://problem/101288278
>
Kimmo Kinnunen
Comment 4
2023-02-01 23:10:14 PST
***
Bug 251506
has been marked as a duplicate of this bug. ***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug