-
Notifications
You must be signed in to change notification settings - Fork 953
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
Shader translation from SPIR-V fails targeting DX12 #3983
Comments
Could you post the trace of a debug build? We should get more info that way since the D3D12 debug layers are only enabled if |
(edited with non cutoff log) |
From the log, these are the expected bindings for the Vertex shader:
What are the bindings you are passing to wgpu? |
Uniform Buffer at 0 and Storage Buffer at 1. Like I mentioned (in the other issue), my code works as expected on Vulkan. |
For the storage buffer, is it a |
Currently I am using auto layouts, so it seems like I don't get to set that. The Buffer usage is |
What is happening here is that we derive the layout via how the global is used in the shader instead of how it's declared (in the shader). wgpu/wgpu-core/src/validation.rs Line 566 in 8a8e00a
Relevant Spec Text: This works fine for all other backends but not the dx12 backend as we will use either an SRV or an UAV for the buffer depending if it's read-only or not. wgpu/wgpu-hal/src/dx12/conv.rs Lines 105 to 114 in 8a8e00a
Conclusion
|
Unfortunately after adding the |
I see that the For reference: from https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Decoration |
Thank you, I made the change you suggested and it worked. |
I have previously filed an issue about this for wgpu-native: gfx-rs/wgpu-native#274
I also have an even smaller trace, it's just a very basic shader that indexes into a Storage Buffer. I've extracted the HLSL output for convenience, but the complete wgpu trace is below.
wgpu-trace.txt
Also the original shader (in SPIR-V form):
shader.zip
The text was updated successfully, but these errors were encountered: