-
Notifications
You must be signed in to change notification settings - Fork 72
asm: deny OpTypeVector
, always infer type from asm params
#392
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cc0bfa6
to
48eb5ac
Compare
48eb5ac
to
538314e
Compare
| ( | ||
TyPat::Vector4(pat), | ||
SpirvType::Vector { | ||
element: ty, | ||
count: 4, | ||
}, | ||
) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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.
…e non-sense ConstOffset
538314e
to
6aa48ff
Compare
Requires #391
Upcoming PR #380 allows
OpTypeVector
to have a "dynamic" size and alignment, to properly differentiate betweenVec3
andVec3A
. But that implies that we can't trivially construct anOpTypeVector
, since we don't know the sizes or alignments it should have. In preparation, this PR denies all usages ofOpTypeVector
inasm!
blocks and changes existing ones to infer the type withtypeof{param}
ortypeof*{param}
, the latter being a pointer to the type that can beOpStore
'ed.