using VecN<bool> causes invalid WGSL
- Dominant language
- Rust
- Stars
- 62
- Forks
- 5
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 14
Description
vec2b, vec3b, vec4b aren't builtin aliases in the [WGSL spec](https://www.w3.org/TR/2026/CRD-WGSL-20260831/#vector-types)
```
#[wgsl]
pub mod my_shader {
#[compute]
#[workgroup_size(1, 1, 1)]
pub fn compute() {
let x: Vec2b = vec2b(false, false);
}
}
```
compiles successfully, but if you try to run the generated WGSL:
```
Shader 'my_shader' parsing error: no definition in scope for identifier: `vec2b`
┌─ wgsl:66:12
│
66 │ let x: vec2b = vec2(false, false);
│ ^^^^^ unknown identifier
```
I think the easiest fix is just to add [custom aliases](https://www.w3.org/TR/2026/CRD-WGSL-20260831/#type-aliases) into the generated WGSL, e.g. `alias vec2b = Vec2;`
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the provided #[wgsl] shader and inspecting its generated WGSL, especially the Vec2b type and vec2b constructor. Add the required boolean-vector aliases to the generated output, then verify that the output parses and no longer reports vec2b as an unknown identifier.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 70/100