-
Notifications
You must be signed in to change notification settings - Fork 124
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
Bumping wgpu from 0.14.2 to 0.15.1 #168
Conversation
Updated all code necessary to run on wgpu 0.15. For now the new view_formats aren't really used and just contain the same format as the texture. The new instance descriptor uses the FXC compiler for Windows and all others. For all others it shouldn't matter as it is Windows only. For Windows the possibility of using the DXC compiler should be explored as it seems to be a better alternative to FXC (https://docs.rs/wgpu-types/0.15.1/wgpu_types/enum.Dx12Compiler.html#variants).
I'll leave this for Fredrik to review in more detail, but LGTM from a cursory glance! If you haven't already, I would test a few of the Nice work, and thank you for the contribution. It's very much appreciated. 😄 |
Oh, I forgot something I thought of earlier.. Updating the shader code, as a global |
@Gosuo there's a fair bit of wgsl being generated in gpu_ecs if I recall correctly. If you grep for |
In wgpu 0.15 global let statements in wgsl shader code was removed in favor of global const statements. This commit addresses those changes.
Okay, like you suggested I built ambient with
I dug a little further and I'm pretty sure the error originates from these lines: There might be more incompatible WGSL things that I cannot check right now, but will test for, if there is a solution for the above mentioned redefinition. |
@Gosuo This is awesome! Yeah I think your analysis that removing the MESH_BUFFER_TYPES_WGSL in one of those locations should fix it. |
I think the problem runs more deeply. I'm finding lots of shadowed variables in wgsl code. As an example: let ang = dot(normalize((mid - anchor)), normalize(corner));
let ang = dot(normalize(mid - anchor), normalize(corner - anchor)); There are a lot more cases like this. I think shadowing is against the wgsl spec, note:
and this comment by kvark. Maybe I misunderstood the spec, but I'm going to start rewriting all the shader code to reflect those rules. This might be something you'd need to talk about in your team, as I expect to change a lot of code there. |
The last commit removed the MeshMetadata shader code from a shader which was used as a header and broke other code. This commit readds it to the header shader and removes it from the actual offending shader with a double definition.
I vastly overestimated the amount of code that needed to be fixed for this. I think this should be it @FredrikNoren. Building ambient on this branch works for me and I get no more shader errors. It might be a good idea to double check if it works on other machines as well, as I am away from home and cannot check on multiple machines for now. |
Awesome, thanks! We'll test it across the platforms next week and merge it if all goes well. This might end up in our 0.2 release depending on scheduling, but I'm looking forward to seeing it landing. Thanks for the contribution, we really appreciate it! |
When porting to the web, we are likely to encounter this issue: I have a minimal wgpu web app demo which encounters the previously mentioned issue when upgrading wgpu |
Looks like this has been fixed gfx-rs/wgpu#3657 🚀 Now we just need to wait for a new release of wgpu, and to update this PR + fix any lingering issues 🙂 |
I'm going to close this PR in favour of #308, as this PR is quite out of date now (our renderer has changed significantly to accommodate the web) Thanks for the work, everyone! Sorry about it not being able to land :( |
Hello,
You guys don't have a policy for contributing, or I didn't find it, so I hope a pull request out of the blue is no problem. If it is, you can reject it, no problem.
Updated all code necessary to run on wgpu 0.15.
Instance::create_surface()
method. I found otherexpect()
s in the code base, so I assume it should be fine for now? There is no error handling inGpu::with_config()
, might be a todo.Maybe I misunderstood the new view_formats parameter, so might be worth to double check that.
Closes #27.