Bug 200872 - [WHLSL] Consider moving as much work from prepare() into createShaderModule as possible
Summary: [WHLSL] Consider moving as much work from prepare() into createShaderModule a...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebGPU (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-18 15:00 PDT by Myles C. Maxfield
Modified: 2020-05-05 00:42 PDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2019-08-18 15:00:59 PDT
Presumably, we could put almost all the processing of prepareShared() inside createShaderModule(). This could be an optimization on some content which reuses shader modules among multiple pipelines.

When we try to merge two modules (when creating a render pipeline), we'll have to have a story about duplicate standard library functions. We can do one of the following:

1) Defer standard library processing until this step, and do it once regardless of the number of shader modules are being joined. This means less work is being done up front inside createShaderModule(), which makes the optimization less powerful.
2) Perform standard library processing in createShaderModule(), and make pipeline creation smart enough to de-duplicate standard library functions.
3) Simply allow duplicate standard library functions. This would likely increase Metal's compile times.
4) Keep it the way it is, and have shader modules be a thin wrapper around strings.
Comment 1 Myles C. Maxfield 2020-05-05 00:42:45 PDT
WHLSL is no longer relevant.