Bug 251514
Summary: | KHR_parallel_shader_compile does not allow for shader compilation without blocking | ||
---|---|---|---|
Product: | WebKit | Reporter: | Martin <mvaligursky> |
Component: | WebGL | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | dino, djg, kbr, kkinnunen, lmoura, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 16 | ||
Hardware: | Mac (Apple Silicon) | ||
OS: | macOS 13 |
Martin
- longer write up is here: https://github.com/mvaligursky/webgl-parallel_shader_compile
- repro: https://htmlpreview.github.io/?https://github.com/mvaligursky/webgl-parallel_shader_compile/blob/main/index.html
Basically, I have a small example that compiles 50 larger shaders, while waiting for the results using the KHR_parallel_shader_compile extension, which is reported as supported.
The problem is that even though this extension seems to work (meaning it does not block), the linkShader step is where all shader compilation seems to take place, and that is a blocking call, blocking the main thread till the shader is compiled. The idea behind the extension is that both compile and link steps are fast, only passing data to the browser, which then compiles the shaders in the background without blocking, and allowing non-blocking query of the results.
The goal here is to compile many shaders, which the main WebGL thread is not blocked at all (the triangle should smoothly rotate).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Kenneth Russell
Note Chromium-side bug crbug.com/1412083 was also filed about this. Ultimately this might be a problem in ANGLE's implementation of the extension; we'd have to look.
Kimmo Kinnunen
Thanks.
Reason is AFAICT just that parallel linking is not yet implemented in ANGLE Metal backend.
Radar WebKit Bug Importer
<rdar://problem/105175241>
Kimmo Kinnunen
*** Bug 243820 has been marked as a duplicate of this bug. ***
Kimmo Kinnunen
*** Bug 223371 has been marked as a duplicate of this bug. ***
Kimmo Kinnunen
*** Bug 223624 has been marked as a duplicate of this bug. ***