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

Update wgpu to 0.13 #1670

Merged
merged 9 commits into from
Jul 3, 2022
Merged

Update wgpu to 0.13 #1670

merged 9 commits into from
Jul 3, 2022

Conversation

expenses
Copy link
Contributor

This should only be merged when a new wgpu release is made

I'm using the git version of naga and currently egui-wgpu panics during shader processing with that because it expects a different syntax for decorations, so I needed to make these changes to get it to work.

@emilk
Copy link
Owner

emilk commented May 23, 2022

Is there a guide of different wgsl versions you could link to? It would be good to stick that in the egui.wgsl file as a guide to further changes!

@expenses
Copy link
Contributor Author

Is there a guide of different wgsl versions you could link to? It would be good to stick that in the egui.wgsl file as a guide to further changes!

Not as far as I'm aware. The latest change was 10 days ago and thing seem to move pretty quickly: gpuweb/gpuweb#2652.

@emilk
Copy link
Owner

emilk commented May 27, 2022

Running this locally on my mac I get:

2022-05-27T08:08:43.837956Z  INFO wgpu_core::instance: Adapter Metal AdapterInfo { name: "Apple M1 Pro", vendor: 0, device: 0, device_type: DiscreteGpu, backend: Metal }    
2022-05-27T08:08:43.849075Z ERROR wgpu::backend::direct: Handling wgpu errors as fatal by default    
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_shader_module
      note: label = `egui_shader`
    
Shader 'egui_shader' parsing error: expected field name or a closing curly bracket to signify the end of the struct, found '@'
  ┌─ wgsl:4:5
  │
4 │     @location(0) tex_coord: vec2<f32>,
  │     ^ expected field name or a closing curly bracket to signify the end of the struct


    expected field name or a closing curly bracket to signify the end of the struct, found '@'

', /Users/emilk/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-0.12.0/src/backend/direct.rs:2273:5

@expenses
Copy link
Contributor Author

@emilk These changes are in preparation for the next wgpu release which should bump naga.

@expenses
Copy link
Contributor Author

I've updated this to the latest wgpu master.

gfx-rs/wgpu#2808 and gfx-rs/wgpu#2808 include some breaking changes so I've modified both the shader and cpu code as a result.

@expenses expenses changed the title Update the wgsl syntax used in egui-wgpu Updates for the upcoming version of wgpu (mostly wgsl syntax changes) Jun 30, 2022
@expenses expenses changed the title Updates for the upcoming version of wgpu (mostly wgsl syntax changes) egui-wgpu updates for the upcoming version of wgpu (mostly wgsl syntax changes) Jun 30, 2022
@expenses expenses marked this pull request as ready for review July 1, 2022 20:04
@expenses expenses changed the title egui-wgpu updates for the upcoming version of wgpu (mostly wgsl syntax changes) Update wgpu to 0.13 Jul 1, 2022
@expenses
Copy link
Contributor Author

expenses commented Jul 1, 2022

@emilk this should be mergeable now!

@expenses
Copy link
Contributor Author

expenses commented Jul 1, 2022

Utgh, I also need to update the syntax in the wgpu demo app: https://github.com/emilk/egui/blob/master/egui_demo_app/src/apps/custom3d_wgpu_shader.wgsl

Unfortunately, I don't know how to test this as the demo app seems pretty hardcoded to use glow at the moment, and I'm not invested enough to change this.

@expenses
Copy link
Contributor Author

expenses commented Jul 1, 2022

Utgh, I also need to update the syntax in the wgpu demo app: https://github.com/emilk/egui/blob/master/egui_demo_app/src/apps/custom3d_wgpu_shader.wgsl

I've done that via checking it with the naga binary. Haven't tested the code though.

@emilk
Copy link
Owner

emilk commented Jul 3, 2022

the demo app seems pretty hardcoded to use glow at the moment

Not at all! (cd egui_demo_app && cargo r --features wgpu)

I tested, and it works!

Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

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

Successfully merging this pull request may close these issues.

2 participants