On Fri Apr 5 20:00:48 2024 +0000, Zebediah Figura wrote:
Copying those shaders here to avoid depending on a possibly ephemeral site:
Buffer<float> buf; float4 main() : sv_target { float a = 0.0; int i = 0; [unroll] for (;; ++i) { if (!(i < 4)) break; if (buf[i] < 0.1) break; if (buf[i] < 0.2) continue; a += buf[i]; } return a; }
Buffer<float> buf; float4 main() : sv_target { float a = 0.0; int i = 0; [unroll] for (;;) { if (!(i < 4)) break; if (buf[i] < 0.1) break; if (buf[i] < 0.2) { ++i; continue; } a += buf[i]; ++i; } return a; }
Note also, curiously, that you get the same difference even if you get rid of the continue block.
Regardless, I would prefer to set aside this optimization for now. I'd rather review a version of copyprop that does not rely on it, before adding that potential complexity, whether or not it's required (and native notwithstanding, it's not clear to me that we will require it).