Rust-GPU / Rust-GPU/rust-gpu

[Migrated] Be more lenient on the vector type used for global_invocation_id

Open
#105 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.4k
Forks
125
PR merge metrics
No merged PRs in 30d

Description

Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/885
Old labels: t: ergonomics
Originally creatd by oisyn on 2022-07-13T09:45:42Z


From @hrydgard: The builtin #[spirv(global_invocation_id)] id: UVec3 needs to be declared as an UVec3, and then truncated if you want a Vec2. In HLSL and GLSL it's common to declare it as a 2-vector instead (UVec2) if you only care about x and y.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the builtin #[spirv(global_invocation_id)] declaration validates its vector type. Compare the current UVec3 requirement with the issue's requested UVec2 behavior, then identify relevant compiler tests or entry points. Done means a two-component declaration is accepted while preserving the existing three-component behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.