On Thu Feb 22 20:02:42 2024 +0000, Zebediah Figura wrote:
I guess explicitly handling every instruction type works too, but it seems a bit fragile. Is there a problem with just clamping out of bounds accesses?
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.