Skip to content

Commit

Permalink
[wgsl]: Clarify attribute Valid Values. (#2924)
Browse files Browse the repository at this point in the history
* [wgsl]: Clarify attribute Valid Values.

This PR clarifies that the valid values must be either `AbstractInt` or
`i32` instead of the more generate `integer literal`.

Issue #2916

* Review feedback
  • Loading branch information
dj2 committed Jun 1, 2022
1 parent f3ece91 commit 7b177e7
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions wgsl/index.bs
Expand Up @@ -775,7 +775,7 @@ An attribute [=shader-creation error|must not=] be specified more than once per
</thead>

<tr><td><dfn noexport dfn-for="attribute">`align`</dfn>
<td>[=integer literal=], yielding a positive i32
<td>[=shader-creation error|Must=] be a positive [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to a member of a [=structure=] type.

[=shader-creation error|Must=] be a power of 2, and [=shader-creation error|must=] satisfy the required-alignment for the member type:
Expand All @@ -791,22 +791,22 @@ An attribute [=shader-creation error|must not=] be specified more than once per

See [[#memory-layouts]]

<tr><td><dfn noexport dfn-for="attribute">`binding`
<td>[=integer literal=], yielding a non-negative i32
<tr><td><dfn noexport dfn-for="attribute">`binding`</dfn>
<td>[=shader-creation error|Must=] be a non-negative [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to a [=resource=] variable.

Specifies the binding number of the resource in a bind [=attribute/group=].
See [[#resource-interface]].

<tr><td><dfn noexport dfn-for="attribute">`builtin`
<tr><td><dfn noexport dfn-for="attribute">`builtin`</dfn>
<td>identifier name for a built-in value
<td>[=shader-creation error|Must=] only be applied to an entry point
function parameter, entry point return type, or member of a [=structure=].

Declares a built-in value.
See [[#builtin-values]].

<tr><td><dfn noexport dfn-for="attribute">`const`
<tr><td><dfn noexport dfn-for="attribute">`const`</dfn>
<td>*None*
<td>Must only be applied to function declarations.

Expand All @@ -817,21 +817,21 @@ An attribute [=shader-creation error|must not=] be specified more than once per
Note: This attribute is used as a notational convention to describe which
built-in functions can be used in [=creation-time expressions=].

<tr><td><dfn noexport dfn-for="attribute">`group`
<td>[=integer literal=], yielding a non-negative i32
<tr><td><dfn noexport dfn-for="attribute">`group`</dfn>
<td>[=shader-creation error|Must=] be a non-negative [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to a [=resource=] variable.

Specifies the binding group of the resource.
See [[#resource-interface]].

<tr><td><dfn noexport dfn-for="attribute">`id`
<td>[=integer literal=], yielding a non-negative i32
<tr><td><dfn noexport dfn-for="attribute">`id`</dfn>
<td>[=shader-creation error|Must=] be a non-negative [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to an [=override declaration=] of [=scalar=] type.

Specifies a numeric identifier as an alternate name for a
[=pipeline-overridable=] constant.

<tr><td><dfn noexport dfn-for="attribute">`interpolate`
<tr><td><dfn noexport dfn-for="attribute">`interpolate`</dfn>
<td>One or two parameters.

The first parameter [=shader-creation error|must=] be an [=interpolation type=].
Expand All @@ -844,7 +844,7 @@ An attribute [=shader-creation error|must not=] be specified more than once per
and [=fragment=] inputs.
See [[#interpolation]].

<tr><td><dfn noexport dfn-for="attribute">`invariant`
<tr><td><dfn noexport dfn-for="attribute">`invariant`</dfn>
<td>*None*
<td>[=shader-creation error|Must=] only be applied to the `position` built-in value.

Expand All @@ -859,8 +859,8 @@ An attribute [=shader-creation error|must not=] be specified more than once per
Note: this attribute maps to the `precise` qualifier in HLSL, and the
`invariant` qualifier in GLSL.

<tr><td><dfn noexport dfn-for="attribute">`location`
<td>[=integer literal=], yielding a non-negative i32
<tr><td><dfn noexport dfn-for="attribute">`location`</dfn>
<td>[=shader-creation error|Must=] be a non-negative [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to an entry point function parameter, entry point
return type, or member of a [=structure=] type.
[=shader-creation error|Must=] only be applied to declarations of [=numeric scalar=] or [=numeric
Expand All @@ -871,7 +871,7 @@ An attribute [=shader-creation error|must not=] be specified more than once per
See [[#input-output-locations]].

<tr><td><dfn noexport dfn-for="attribute">`size`</dfn>
<td>[=integer literal=], yielding a positive i32
<td>[=shader-creation error|Must=] be a positive [=i32=] or [=AbstractInt=] [=integer literal|literal=]
<td>[=shader-creation error|Must=] only be applied to a member of a [=structure=] type.

The number of bytes reserved in the struct for this member.
Expand Down

0 comments on commit 7b177e7

Please sign in to comment.