Matteo Bruni (@Mystral) commented about libs/vkd3d-shader/hlsl_codegen.c:
- size_t i;
- for (i = 0; i < 4; ++i)
- for (i = 0; i < allocator->count; ++i) {
if (allocator->regs[component_idx + i].last_read <= first_write)
{
writemask |= 1u << i;
if (++count == reg_size)
return writemask;
}
const struct allocation *allocation = &allocator->allocations[i];
/* We do not overlap if first write == last read:
* this is the case where we are allocating the result of that
* expression, e.g. "add r0, r0, r1". */
I'm confused by this comment: doesn't that example show that you can in fact use the same register as both source and destination?