fixed incorrect packed_int3 conversion generated for Metal - #9355
Conversation
| metal::float3 svm0_ = data.v3_ * 2.0; | ||
| metal::float3 svm1_ = 2.0 * data.v3_; | ||
| metal::float3 l0_ = metal::float3(data.v3_); | ||
| metal::float2 l1_ = metal::float3(metal::float3(data.v3_)).zx; |
There was a problem hiding this comment.
question: This double cast seems incorrect, though I suspect it's harmless, but I'm not sure. @teoxoy or @jimblandy, do you know? It's also suspect that this is already being emitted in some cases, but not others. Perhaps we need to plumb a need to cast somewhere else, rather than doing it in multiple places?
There was a problem hiding this comment.
after inspecting the metalIR this will get optimized away, in fact the compiler will handle most of the conversion between packed and unpacked, and it looks like the only issue is with the bit-cast from packed type to unpacked, i'll update the code to handle that
ErichDonGubler
left a comment
There was a problem hiding this comment.
I'll take on review. This broadly looks like it improves things, but I have questions about the approach WRT double casts.
ErichDonGubler
left a comment
There was a problem hiding this comment.
Noice! Much simpler. 👍🏻
Connections
#9091
Description
translated MSL now correctly unpacks
packed_type3before using it with other unpacked types.Testing
added a test that test against this issue
Squash or Rebase?
squash
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.