Fragment shader integer built-ins incorrectly require `flat`
Open
@Firestar99 is already working on this.
Since Jan 5, 2026.
bug
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
Integer Built-ins in fragment shaders currently require the flat decoration, like in our compiletest:
https://github.com/Rust-GPU/rust-gpu/blob/a30bd43db45f2bfe260051f44141e5eaffcbb4b0/tests/compiletests/ui/spirv-attr/all-builtins.rs#L96-L100
otherwise compile will fail with:
error: `Fragment` entry-point `Input` parameter must be decorated with `#[spirv(flat)]`
--> crates/restir-shader/src/visibility/raster.rs:40:39
|
40 | #[spirv(primitive_id)] primitive_id: u32,
| ^^^
However, decorating them with flat makes no sense and may even be illegal, since they are builtins, and flat configures interpolation behaviour.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.