Skip to content

Conversation

@LegNeato
Copy link
Collaborator

@LegNeato LegNeato commented Jan 9, 2026

LocalInvocationIndex is a scalar u32 builtin, not a UVec3 vector:

https://docs.vulkan.org/refpages/latest/refpages/source/LocalInvocationIndex.html

The tests incorrectly used UVec3 which was not caught by spirv-val.

LocalInvocationIndex is a scalar u32 builtin, not a UVec3 vector:

https://docs.vulkan.org/refpages/latest/refpages/source/LocalInvocationIndex.html

The tests incorrectly used UVec3 which was not caught by spirv-val.
This should be checked by spirv-opt but it is not catching it.
Even if they fix the issue, it doesn't hurt to double check as this
will never change.
@LegNeato LegNeato changed the title Fix incorrect LocalInvocationIndex type in tests Fix incorrect LocalInvocationIndex type Jan 9, 2026
Copy link
Member

@Firestar99 Firestar99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've actually been incorrectly using local_invocation_index with a UVec3 cause I confused it with local_invocation_id: UVec3 for quite some time, and only noticed like last week or so cause I had a two dimensional workgroup. 😅

The difference for an 8x8 workgroup:

  • local_invocation_id: UVec3 has a range of 0..8, 0..8, 0
  • local_invocation_index: u32 has a range of 0..64 = 0..(8*8)
  • from experimental results on all platforms I tested local_invocation_index: UVec3 seems to be equivalent to UVec3::new(local_invocation_index, 0, 0), but this could as well be UB

@Firestar99 Firestar99 added this pull request to the merge queue Jan 9, 2026
Merged via the queue into Rust-GPU:main with commit 9906ead Jan 9, 2026
13 checks passed
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

Successfully merging this pull request may close these issues.

2 participants