-
Notifications
You must be signed in to change notification settings - Fork 86
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
Upgrade to wpgu 0.10 #66
Conversation
For me, every example fails except the cube sample:
|
All examples work when forcing the backend to |
The failing build steps are caused by new clippy warnings, #68 fixes those in a separate PR. |
Thanks for this! #68 is in, so you can rebase. |
@willemv Interesting that it seems to fail in the shader validation stage. In this PR those compiled shaders are unchanged. I wonder if this is an issue introduced in the wgpu D3D backend in version 0.10. You might try this PR in conjunction with #67. Naga will likely compile shaders to more wgpu-compliant SPIR-V. |
@kylc Thanks for the suggestion. I tried in conjunction with your #67 PR, but that didn't fix it Looking into this some more, it looks like a bug in naga. It translates the compiled spirv file to a hlsl file containing the following struct : struct VertexInput_vs_main {
float2 member : LOC0;
float2 member : LOC1;
float4 member : LOC2;
}; which is obviously wrong (three members with the same name). I'll log an issue with naga to follow up on this. In the meantime, we could convert the shaders to straight wgsl, which, I think, will avoid the bug by losing less naming information. |
I think converting the shaders to wgsl is likely a good idea anyway. I can help with this process if it's needed. |
I'm not familiar with wgsl, so @cwfitzgerald if you could help with that that would be nice |
I have a WGSL conversion over on this branch: https://github.com/kylc/imgui-wgpu-rs/tree/to-wgsl The differences are 1) the individual vertex and fragment shaders have been combined into a single shader in the imgui code, 2) there is no WGSL preprocessor so we have to use simple string substitution to manage the SRGB/linear color definitions. I had originally abandoned the effort because I read WGSL was not yet supported by some wgpu backends (web?), but I can no longer find that info so I may be mistaken. |
@kylc the code looks good, but we should be able to do without the string replacement by having multiple entry points:
Then when we make the pipeline, just also pass in the fragment shader entry point name. |
Great idea, I hadn't considered that. I will update the branch and open a PR when I have a chance. |
Thank you so much! |
See #69 for shader translation to WGSL. |
- It would be nice to return an error from the render function - imgui-winit is still a WIP (open PR: Yatekii/imgui-wgpu-rs#66) - minimal-fltk flashes wildly! :(
I finally got around to logging that issue: gfx-rs/naga#1316 |
@kylc what's the status here, naga patch will be out in the next couple hours :) |
- It would be nice to return an error from the render function - imgui-winit is still a WIP (open PR: Yatekii/imgui-wgpu-rs#66) - Update README Co-authored-by: Mohammed Alyousef <mohammed.alyousef@neurosrg.com>
I haven't yet been able to resolve the deadlock issue in the cube example that I mentioned in the PR. That said, it only happens on one of my machines (Intel UHD 620/Vulkan backend) and the cube demo seems like a somewhat non-standard usage of wgpu, creating multiple CommandEncoders per render frame. I'd be curious to hear if anyone else has trouble with the cube example. If not, maybe this is just down to the configuration of that one machine and shouldn't hold up this merge. |
@kylc this seems like gfx-rs/wgpu#1672 which, while unfortunate, we shouldn't block on. |
fd1913c
to
a234b59
Compare
Thanks for tracking that down. Ready to merge on my end. I just rebased and updated the changelog. |
Fixed formatting issues. |
Thank you so much! I want to land this and #69 and I'll cut a release. |
Is there any plan when the release will be rolled out? I'd like to upgrade to wgpu 0.10 myself but have to wait for the changes in this PR to be released. |
@ChristianIvicevic cutting a release as we speak |
Published! |
Thank you @cwfitzgerald! |
This PR updates the library to be compatible with wgpu 0.10.
Everything compiles and all the demos run, except for the
cube.rs
demo. It seems to stall out in theExample::render()
function when submitting the command buffer to the queue. I will need to investigate if this is due to a change in wgpu or just a bug in updating to the latest version.Because of this unsolved issue this PR is marked as WIP.
Fixes #65