On Fri Nov 10 02:48:40 2023 +0000, Francisco Casas wrote:
Well, `register(cX)` only has effect on the `$Globals` constant buffer and `packoffset()` cannot be used on it (because the variable must be inside a `cbuffer` declaration). I added a test that checks that `register(cX)` has no effect inside a cbuffer:
cbuffer c { float4 a : packoffset(c1); float4 b : packoffset(c2) : register(c1); // ^ register(c1) ignored for cbuffer that is not $Globals. } float4 main() : sv_target { return a + b; }
Note that the packoffset(cX) is required on the second field because if one cbuffer member uses packoffset() all others must. However, this would still be a todo since currently don't support multiple register() or packoffset() declarations in the same variable, we would have to modify the parser and vectorize the `reservation` field, but I didn't think this was something to worry about yet.
I don't understand? I'm not talking about cbuffers. I just mean tests for declaring multiple global variables, some with register(cX) and some without.