Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/ir.c:
+ return false; + } + + signature->scan[base].need_normalisation = true; + e = &s->elements[base]; + + /* Find the lowest register with at least array_size free above. */ + for (i = base, j = ((1u << array_size) - 1) << base; i < MAX_REG_OUTPUT; ++i, j <<= 1) + { + if (!(reg_mask & j)) + break; + } + + /* Signature locations are not used for sysvals, so if it proves necessary, it should be + * ok to raise MAX_REG_OUTPUT to 40 and validate that non-sysval register indices are < 32. */ + if (array_size > MAX_REG_OUTPUT - i) Personally I hate this pattern and always want it to be a helper function. I know others don't mind, though.
-- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/564#note_62262