Skip to content
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

Uses import.meta.url which is not compatible with webpack #15

Open
MTRNord opened this issue Sep 17, 2021 · 2 comments
Open

Uses import.meta.url which is not compatible with webpack #15

MTRNord opened this issue Sep 17, 2021 · 2 comments

Comments

@MTRNord
Copy link

MTRNord commented Sep 17, 2021

Note: this is paired with mrdoob/three.js#22549

As described over at three.js this seems to use a feature that only works with nodejs but not browser based as with webpack/angular.

The line for it is https://github.com/kainino0x/glslang/blob/851f3daad0efb7e69a6bec4fd07fe60067104a4a/glslang/OSDependent/Web/glslang.after.js#L6-L7 in this project.

The import.meta.url will with webpack generate a file:// url referencing the local build env. Likely something like done to fix mrdoob/three.js#21696 would make sense to fix this. :)

If any more information is needed the threejs issue has a bit more information and an example page.

@kainino0x
Copy link
Owner

kainino0x commented Sep 17, 2021

Thanks for the report, but sadly I have no idea how to fix this. When I was working on this project I tried for a while to figure it out, but the JS bundling ecosystem is so fragmented that I found it impossible. If you can recommend a fix I'd be happy to take it.

That said, SPIR-V in WebGPU is all but obsolete at this point, and it won't be available in Chrome's Origin Trial. Please consider translating code to WGSL instead, e.g. using Naga as described here for noclip.website: https://youtu.be/kZCqRlabZiU?t=854

@MTRNord
Copy link
Author

MTRNord commented Sep 17, 2021

Hm yeah sadly I guess I have to wait on threejs for conversion :D They use this library :)

(Though apart from that for personal use in the long term I will move to wgpu-rs and wasm to use wgsl. This was just planned as a intermediate step for me.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants