@@ -88,7 +88,9 @@ struct RootConstants {
8888// Models the end of a descriptor table and stores its visibility
8989struct DescriptorTable {
9090 ShaderVisibility Visibility = ShaderVisibility::All;
91- uint32_t NumClauses = 0 ; // The number of clauses in the table
91+ // Denotes that the previous NumClauses in the RootElement array
92+ // are the clauses in the table.
93+ uint32_t NumClauses = 0 ;
9294
9395 void dump (raw_ostream &OS) const ;
9496};
@@ -123,7 +125,21 @@ struct DescriptorTableClause {
123125 void dump (raw_ostream &OS) const ;
124126};
125127
126- // Models RootElement : RootConstants | DescriptorTable | DescriptorTableClause
128+ // / Models RootElement : RootFlags | RootConstants | DescriptorTable
129+ // / | DescriptorTableClause
130+ // /
131+ // / A Root Signature is modeled in-memory by an array of RootElements. These
132+ // / aim to map closely to their DSL grammar reprsentation defined in the spec.
133+ // /
134+ // / Each optional parameter has its default value defined in the struct, and,
135+ // / each mandatory parameter does not have a default initialization.
136+ // /
137+ // / For the variants RootFlags, RootConstants and DescriptorTableClause: each
138+ // / data member maps directly to a parameter in the grammar.
139+ // /
140+ // / The DescriptorTable is modelled by having its Clauses as the previous
141+ // / RootElements in the array, and it holds a data member for the Visibility
142+ // / parameter.
127143using RootElement = std::variant<RootFlags, RootConstants, DescriptorTable,
128144 DescriptorTableClause>;
129145
0 commit comments