On Fri Apr 21 22:00:40 2023 +0000, Francisco Casas wrote:
Isn't the register count the same thing as the register size here?
Actually, I'm not sure I see the difference in general? I thought there was a convention of "element" vs "register", but apart from that...? When I said count, I refer to the `hlsl_reg.count`, which is the number of registers that a given variable (or field) **requires** to allocate, currently used by allocate_register_reservations() and allocate_objects(), which may be different depending on how the variable's components are used across the shader. Another difference between `hlsl_reg.count` and the variable's type's `reg_size`, is that it is currently expressed in whole registers not register components. This difference is only meaningful for numeric registers, where each register has 4 components, and while I am initializing `hlsl_reg.count` now, it is not used for numeric components so far. I updated the documentation to clarify.
Yeah, I don't think we want to ascribe "count" vs "size" to that distinction if we can avoid it. Something like "reserved" vs "used" would probably be better.