Bug 251514 - KHR_parallel_shader_compile does not allow for shader compilation without blocking
Summary: KHR_parallel_shader_compile does not allow for shader compilation without blo...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGL (show other bugs)
Version: Safari 16
Hardware: Mac (Apple Silicon) macOS 13
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 223371 223624 243820 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-02-01 07:30 PST by Martin
Modified: 2023-03-23 01:17 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin 2023-02-01 07:30:36 PST
- 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).
Comment 1 Kenneth Russell 2023-02-01 11:14:27 PST
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.
Comment 2 Kimmo Kinnunen 2023-02-01 23:45:52 PST
Thanks.
Reason is AFAICT just that parallel linking is not yet implemented in ANGLE Metal backend.
Comment 3 Radar WebKit Bug Importer 2023-02-08 07:31:17 PST
<rdar://problem/105175241>
Comment 4 Kimmo Kinnunen 2023-03-23 01:17:25 PDT
*** Bug 243820 has been marked as a duplicate of this bug. ***
Comment 5 Kimmo Kinnunen 2023-03-23 01:17:31 PDT
*** Bug 223371 has been marked as a duplicate of this bug. ***
Comment 6 Kimmo Kinnunen 2023-03-23 01:17:42 PDT
*** Bug 223624 has been marked as a duplicate of this bug. ***