On Fri Feb 23 13:38:55 2024 +0000, Conor McCarthy wrote:
Indeed it's a bit fragile. It could instead copy up to four components to the temp, if available, just in case, but I don't like the idea of doing that each time a scalar is loaded. It's pretty spammy in SPIR-V code, and the temp is often used for other purposes later, where the written values could still be floating around if not overwritten. That's unlikely to interfere with optimisation, but I'm not sure.
It's a fair concern. Although if it only matters for clip/cull—not even stores, but *loads*—maybe we don't need to worry about optimization anyway? I'd be (naïvely) surprised if those are frequent.
Longer term we should think about storing this information in a friendlier format at parse time...
I would at least advocate for not using an empty default: case like that; vsir is awfully extensible and we should have a FIXME for unhandled instructions.