First, I have to say, stellar work on this! ๐คฏ
I noticed this footnote, and would like to correct any error on the Wiki page this refers to, but I couldn't identify the error:
|
This page has a small error, it first lists the rules for structured buffers, which include "Structs are aligned by the max of it's member alignments", and then says |
|
"legacy" constant buffer rules apply on top of that, which is not true for this specific rule as demonstrated in the example for <a href="#rule4">Rule #4</a>. |
and then says "legacy" constant buffer rules apply on top of that, which is not true for this specific rule as demonstrated in the example for Rule #4.
This seems to imply a lack of basis for forcing alignment to 16 for structures in the document for Rule 4.
Under "Legacy" Constant Buffer Basics
it says:
- Aggregates (arrays and structures) are always 16-byte row-aligned. ...
This point appears to be the basis for Rule 4, and it supersedes the basic type alignment rule when a struct appears in a cbuffer.
I think the basic point about alignment for the structure is that the structure itself does not force alignment of 16. The alignment to 16 is required when the struct is included inside a constant buffer.
Perhaps your interpretation of what's written is different than mine. If so, can you more clearly identify the error you're referring to?