-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove sourceMap
from GPUShaderModuleDescriptor
#4808
Comments
This proposal seems to make sense to me. |
Agreed seems like we can remove |
It would be kinda cool to have some fetchSourceMap: async function() -> souceMap, but URL sounds like the main solution, and the one JS uses is a good reason. |
Some things to think about:
|
Filed #4844 for reintroducing source maps. |
GPU Web WG 2024-08-28 Atlantic-time
|
Currently,
GPUShaderModuleDescriptor
is defined asI started to write a library to try to use
sourceMap
and I"m starting to think maybe this property is the wrong solution.The problem is, this property is effectively asking for a loaded and parsed sourceMap before knowing that we actually need the sourceMap.
In other words, you start with this synchronous code
You decide to add a sourceMap. This is now required
Your code is no longer synchronous and has to be refactored. Of course, you could try to bundle your source maps into your build but that"s certainly not the precedent of source maps from JavaScript.
Instead, I"d like to suggest that WebGPU should follow JavaScript"s lead here and just use a sourcemap comment in the WGSL
//# sourceMappingURL=http://example.com/path/to/your/sourcemap.map
The advantage to this way is the implementation (or library, debugger, etc) is free to load the source maps on demand.
Example:
With this design, usage still appears synchronous
And, the source map is only loaded, if there was an error. (less memory, less bandwidth, less startup time, ....)
WebGPU implemetations are still free to support or not support source maps. It"s just that moving them to comments, the same as JavaScript, gives the implementation more flexibility in when to load them.
Note that an implementation that wants to generate a sourceMap at runtime would still be free to do so with
//# sourceMappingURL=data:,...json....
or//# sourceMappingURL=data:text/plain;base64,....==
The text was updated successfully, but these errors were encountered: