-
Notifications
You must be signed in to change notification settings - Fork 344
Description
We'd like to be able to put most of the work involved by createShaderModule off-thread but this is awkward because of the way createShaderModule reports errors. We want to compile shader modules off-thread so that an application can create tons of shadermodule and async pipelines without stalling the rest of the WebGPU processing.
Currently errors during compilation of shader modules happen immediately during the createShaderModule call. This means that due to promise ordering of error scopes, either shader modules are created immediately, or (under the as-if rule) other device-timeline callbacks are delayed until we know the result of createShaderModule. What if we said that createShaderModule errors only appeared inside 1) the compilation messages or 2) when the shader module is used to create a pipeline?
FYI @Jiawei-Shao