Documentation for "Packing Rules for Constant Variables" is wrong
Documentation for Packing Rules for Constant Variables (https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-packing-rules or https://github.com/MicrosoftDocs/win32/blob/da3bae6a0e8408f155ae39f99105e317f9e8f082/desktop-src/direct3dhlsl/dx-graphics-hlsl-packing-rules.md?plain=1#L115) is wrong.
I'm making constant buffer in DirectX11 HLSL (shader model 5) and introspecting it through the code:
Shader code looks like this:
And my program output:
So, size of constant buffer is 32 bytes. I assume, it is packed like this:
Documentation stands, that:
I assume, it is packed like this:
Documentation's constant buffer is 48 bytes long. Actual (mine): 32 bytes. Structures identical, no special shader compilation flags provided.
This documentations is in category "Shader Model 4", so I also tried "ps_4_0" profile, but nothing has changed.
I generally understand, how packing for HLSL shaders works. I'm trying to write app which uses shader reflection to generate structures of buffers for C++. HLSL's actual packing is ok, but documentation makes me upset, like I'm doing something wrong.
Please, help me to determine where is the mistake.