-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
step030 Can not load SPIR-V shader #39
Comments
Any update? |
Unfortunately, I don't think the WebGPU spec specifies loading SPIR-V directly. You'd have to use a transpiler like naga or tint to compile your shader code into wgsl.
I assume this is referring to naga/spv-in? These notes on SPIR-V to WGSL translation efforts in Tint make me wonder about the efficiency and losslessness on a high-level. Never mind... Just realized you're already using wgpu-native. This seems related: gfx-rs/wgpu#4915. Have you tried compiling with |
The Web version of WebGPU (i.a., what browsers support) does not support loading SPIR-V directly indeed. However, the native version of WebGPU backends has extra features, and both Dawn and wgpu-native do support it actually. Actually, the Note that in the As for the original issue, it is a wgpu-native specific one. After searching in their codebase, it seems to come from this line in |
I tried to compile with glslangValidator, but unfortunately it didn't work. I tested this on other systems(Windows 10 MSYS2 MinGW64 and Ubuntu 22.04 g++) and this issue also appears there. Also it can't be something with my spv file, because I was just able to successfully upload this shader to Vulkan using functions I have given above. The only one way out for me - use P.S. Does not apply to this issue, after the last commit in the webgpu.hpp file of the wgpu branch, an error occurs that the |
Wow my bad, I fixed this thx for reporting!
Mmh ok, could you share your very spv file (+ the text version)? I'll try with both Dawn and wgpu-native, it may be a bug of the latter that we need to report. |
Of course, uploaded it here |
Both wgpu-native and Dawn are unhappy with wgpu-native
Dawn
|
I have a function that loads spv file:
I am trying to create the shader as follows:
But it crashes with error:
I also tried to use this variant of loading:
But it causes the same error.
Here is my shader code:
Compiled with
glslc v.vert -o v.spv
System: MacOS Ventura (Intel)
How can I correctly load SPIR-V shader?
The text was updated successfully, but these errors were encountered: