Zebediah Figura (@zfigura) commented about libs/vkd3d-shader/hlsl.h:
* and the buffer_offset instead. */ struct hlsl_reg regs[HLSL_REGSET_LAST + 1];
- struct {
bool used;
- } *objects_usage[HLSL_REGSET_LAST_OBJECT + 1];
Thought: what if we tracked this per component instead?
The current usage is close enough to RA / backend logic that I don't think it matters much from a design perspective, but I do suspect that in general this would make things a bit simpler, if only because it's a single array instead of several.
In fact, we could potentially expand this in the future to store other per-component logic. One particularly salient thing that comes to mind is tracking whether we need to use a bool / int variable for sm1 uniforms—which itself determines the size of each register set.
I think the downside is that request_object_registers_for_allocation() has to do a bit more work, but at least it's very clear and straightforward work.
(Also, style nitpick: imbalanced braces.)