asm: deny OpTypeVector, always infer type from asm params - #392
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.
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.
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.
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
|
how are you meant to use the typeof{}? you cant pass in a parameter holding a glam vec |
|
Try |
Requires #391
Upcoming PR #380 allows
OpTypeVectorto have a "dynamic" size and alignment, to properly differentiate betweenVec3andVec3A. 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 ofOpTypeVectorinasm!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.