Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions specs/language/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

\begin{grammar}
\define{function-specifier}\br
\texttt{export}\br
\terminal{export}
\end{grammar}

\p The \texttt{export} specifier denotes that the function has program linkage (\ref{Basic.Linkage.Program}).
Expand All @@ -64,6 +64,36 @@
\p If a function is declared with an \texttt{export} specifier then all redeclarations of the same function must also use the \texttt{export} specifier or be part of \textit{export-declaration-group} (\ref{Decl.Export}).

\Sec{Declarators}{Decl.Decl}

\begin{grammar}
\define{init-declarator-list}\br
init-declarator\br
init-declarator-list \terminal{,} init-declarator\br

\define{init-declarator}\br
declarator \opt{initializer}\br

\define{declarator}\br
declarator-id \opt{attribute-specifier-seq}\br
declarator parameters-and-qualifiers\br
declarator \terminal{\lbrack} \opt{constant-expression} \terminal{\rbrack} \opt{attribute-specifier-seq}\br

\define{parameters-and-qualifiers}\br
\terminal{(} parameter-declaration-clause \terminal{)} \opt{cv-qualifier-seq} \opt{attribute-specifier-seq}\br

\define{cv-qualifier-seq}\br
cv-qualifier \opt{cv-qualifier-seq}\br

\define{cv-qualifier}\br
\terminal{const}\br

\define{declarator-id}\br
id-expression

\end{grammar}



\Sec{Initializers}{Decl.Init}

\p The process of initialization described in this section applies to all
Expand Down Expand Up @@ -180,7 +210,7 @@
(\ref{Resources.cnbuf}).

\p The cbuffer declaration itself does not declare a declaration scope.
Declarations within a cbuffer declaration that declare names, declare their names
Declarations within a cbuffer declaration that declare names, declare their names
in the scope containing the cbuffer declaration. A cbuffer declaration may not
contain a \textit{namespace-declaration} or \textit{cbuffer-declaration}.
\footnote{These declarations were previously allowed in HLSL reference compilers
Expand Down
9 changes: 5 additions & 4 deletions specs/language/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@
(\ref{Overload}).\footnote{HLSL does not support the base address of a subscript
operator being the expression inside the braces, which is valid in C and C++.}

\p If the postfix expression \texttt{E1} is of vector type, the expression
\textit{E2} must be a value of integer type. If the value is known at compile
\p If the postfix expression \texttt{E1} is of array, vector or matrix type, the
expression \textit{E2} must be a value of integer type, or of a type that is
implicitly convertible to integer type. If the value is known at compile
time to be outside the range \texttt{[0, N-1]} where \texttt{N} is the number of
elements in the vector, the program is ill-formed. If the value is outside the
range at runtime, the behavior is undefined.
Expand Down Expand Up @@ -213,7 +214,7 @@
\textit{swizzle-component-xyzw} forms; the two forms may not be mixed in the
same \textit{vector-swizzle-component-sequence}. The type of a swizzle expression is a
vector of the same element type as the postfix expression before the dot, with a
number of elements equal to the number of components in the \textit{vector-swizzle-component-sequence}.
number of elements equal to the number of components in the \textit{vector-swizzle-component-sequence}.

\p Vector swizzle components map to elements of the vector in the following way:

Expand Down Expand Up @@ -270,7 +271,7 @@
\p A \textit{matrix-swizzle-component-sequence} is a sequence of one but less
than or equal to four swizzle components of either the
\textit{matrix-zero-indexed-swizzle} or \textit{matrix-one-indexed-swizzle}
forms; the two forms may not be mixed in the same
forms; the two forms may not be mixed in the same
\textit{matrix-swizzle-component-sequence}. The type of a swizzle expression is
a vector of the same element type as the postfix expression before the dot,
with a number of elements equal to the number of components in the
Expand Down