hecrj / wgpu_glyph

A fast text renderer for wgpu (https://github.com/gfx-rs/wgpu)
https://docs.rs/wgpu_glyph
MIT License
450 stars 78 forks source link

Add default branch to wgsl switch #79

Closed Bobo1239 closed 2 years ago

Bobo1239 commented 2 years ago

From the WGSL spec: "Each switch statement must have exactly one default clause."

Chrome/Tint emits the following error when compiling the shader:

Tint WGSL reader failure:
Parser: 35:5 error: switch statement must have a default clause
    switch (i32(input.vertex_index)) {
    ^^^^^^

naga doesn't yet validate the presence of a default clause but should do so soonish via https://github.com/gfx-rs/naga/pull/1529.