Technically true, but I feel like this could be clearer. Perhaps something like "must be properly aligned"?
"proper_offset" is not a very clear name for a variable. "aligned_offset" strikes me as clearer.
Okay, I also changed the error message to:
"Reservation with swizzle in packoffset() breaks register boundaries."
I'm not sure this is great either. For example, it's legal to write "float1x1 a : packoffset(c2.x)" [although, interestingly, not c2.y!] I also don't much like the term "breaks".
We probably should explicitly test those two as well.
Hmm, I am pretty sure that, at least now, `calculate_buffer_offset()` is called on all variables within constant buffers, not only used variables.
Ack, you're right, I don't know how I got confused like that...