Skip to content

Conversation

Firestar99
Copy link
Member

@Firestar99 Firestar99 commented Sep 17, 2025

Requires #391

Upcoming PR #380 allows OpTypeVector to have a "dynamic" size and alignment, to properly differentiate between Vec3 and Vec3A. But that implies that we can't trivially construct an OpTypeVector, since we don't know the sizes or alignments it should have. In preparation, this PR denies all usages of OpTypeVector in asm! blocks and changes existing ones to infer the type with typeof{param} or typeof*{param}, the latter being a pointer to the type that can be OpStore'ed.

@Firestar99 Firestar99 changed the base branch from main to matrix4x3 September 17, 2025 11:52
@Firestar99 Firestar99 mentioned this pull request Sep 17, 2025
Base automatically changed from matrix4x3 to main September 17, 2025 12:43
Comment on lines 720 to 726
| (
TyPat::Vector4(pat),
SpirvType::Vector {
element: ty,
count: 4,
},
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one might be fine to keep? Since it expects the vector to already exist, it's not synthesizing a new one.

Copy link
Member Author

Choose a reason for hiding this comment

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

In theory yes, we could. But without the change below constructing a SpirvType::Vector, automatic type resolution doesn't work anyway. Just tried it by undoing the OpSample* explicit typing I added.

Will readd it anyway, can't hurt :D

create different vector types due to varying size and alignment",
)
.with_note(
"pass `glam::VecN` as parameters and use `typeof{foo}` or `typeof*{foo}` (pointer to type) to resolve vector type",
Copy link
Collaborator

Choose a reason for hiding this comment

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

In theory we could extract the operands and suggest the exact correct type, but that feels overkill.

@Firestar99 Firestar99 added this pull request to the merge queue Sep 17, 2025
Merged via the queue into main with commit adfe6b8 Sep 17, 2025
13 checks passed
@Firestar99 Firestar99 deleted the asm_vector_deny branch September 17, 2025 15:10
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