On Mon Jan 23 19:32:28 2023 +0000, Zebediah Figura wrote:
Why separate this?
In later patches there is the need to insert an intermediate step between allocating register reservations and performing the register allocation perse:
```c allocate_register_reservations(ctx);
request_object_registers_for_allocation(ctx);
allocate_temp_registers(ctx, entry_func); ```
This `request_object_registers_for_allocation()` takes care of setting the count of reserved registers for object arrays. In particular, for sampler arrays, this count is given by the last sampler of the array that is actually used in the shader. So, all these register counts have to be calculated previously to make `get_allocated_object()` simple.
Also, I think it is a nice way of taking a little bit of complexity away from `allocate_objects()`.