Skip to content

Conversation

eddyb
Copy link
Member

@eddyb eddyb commented Oct 13, 2025

Ideally this change would apply only to #[rust_gpu::vector::v1] types (as they're the ones which can end up being passed as pairs when they have only 2 components, e.g. glam::{Vec2,IVec2,UVec2} etc.), but checking that from a query override (which is where this logic is right now) isn't exactly trivial.

However, I don't expect doing this across the board (i.e. to all structs and enums that would've gotten passed as two scalar args) to cause any issues, not even performance ones (at least on reasonable drivers).

Motivated by (and unlocks):

More specifically, it should remove the dependency on this other PR:

  • Support scalar pair ABI #381
    (still want to land that, but it makes more sense as an diagnostic UX improvement, while semantically IMO we should not be decomposing and recomposing vector types just because we're not using #[repr(simd)] anymore)

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.

Looks good!

I tried rebasing #381 locally and ran into some compiletest disassembly changes, caused both by this PR and the "Erase explicit layout decorations" PR, but all trivial changes. (Next to me forgetting to clear certain target folders)

@eddyb eddyb added this pull request to the merge queue Oct 13, 2025
Merged via the queue into Rust-GPU:main with commit 6a9ea3b Oct 13, 2025
13 checks passed
@eddyb eddyb deleted the direct-even-pairs branch October 13, 2025 13:40
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