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

Default not working with another clause #3441

Closed
Norlock opened this issue Jan 31, 2023 · 3 comments
Closed

Default not working with another clause #3441

Norlock opened this issue Jan 31, 2023 · 3 comments

Comments

@Norlock
Copy link

Norlock commented Jan 31, 2023

Description
According to the specs you should be able to include default with another clause. This does not seem to work.
https://github.com/Norlock/sparticles/blob/bug-switch/src/shaders/trail_render.wgsl

Repro steps

git clone https://github.com/Norlock/sparticles.git
git checkout bug-switch
cargo run --release --example default

Expected vs observed behavior
Expected: working switch.
Observed behaviour:

Caused by:
    In Device::create_shader_module
      note: label = `particle`
    
Shader 'particle' parsing error: expected unsigned/signed integer literal, found 'default'
    ┌─ wgsl:170:18170 │         case 5u, default {
    │                  ^^^^^^^ expected unsigned/signed integer literal


    expected unsigned/signed integer literal, found 'default'

Platform
I'm running on Linux, with Vulkan backend, wgpu version 14.

@teoxoy
Copy link
Member

teoxoy commented Jan 31, 2023

wgpu v15 and naga v11 have been released recently which contain gfx-rs/naga#2126.

Could you update and give it another shot?

@Norlock
Copy link
Author

Norlock commented Jan 31, 2023

I have updated to version 15:

But it won't even start https://github.com/Norlock/sparticles/tree/version-15. Maybe I forgot something, otherwise I will make another ticket for 15.

@Norlock
Copy link
Author

Norlock commented Feb 1, 2023

Yes updating fixed the issue, thanks.

@Norlock Norlock closed this as completed Feb 1, 2023
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

No branches or pull requests

2 participants