Skip to content

Commit

Permalink
Disallow taking the address of a handle (#1983)
Browse files Browse the repository at this point in the history
SHA: f5aeea2
Reason: push, by @dneto0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
alan-baker and github-actions[bot] committed Jul 27, 2021
1 parent 96382ca commit 1415593
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions wgsl/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@
</style>
<meta content="Bikeshed version 59d067506, updated Fri Jul 23 15:43:29 2021 -0700" name="generator">
<link href="https://www.w3.org/TR/WGSL/" rel="canonical">
<meta content="5a4766c4c3d296b9f4655fdff5990e86f36edbaf" name="document-revision">
<meta content="f5aeea2b2652bc47f362c9edc003303ba07853d6" name="document-revision">
<style>
tr:nth-child(2n) {
background-color: #b0b0b050;
Expand Down Expand Up @@ -6842,6 +6842,7 @@ <h3 class="heading settled" data-level="6.15" id="address-of-expr"><span class="
same <a data-link-type="dfn" href="#memory-view" id="ref-for-memory-view④">memory view</a> as the reference value <var>r</var>.
<p>If <var>r</var> is an <a data-link-type="dfn" href="#invalid-memory-reference" id="ref-for-invalid-memory-reference④">invalid memory reference</a>, then the resulting
pointer is also an invalid memory reference.</p>
<p>It is a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a> if <var>SC</var> is the <a data-link-type="dfn" href="#storage-classes-handle" id="ref-for-storage-classes-handle②">handle</a> storage class.</p>
</table>
<h3 class="heading settled" data-level="6.16" id="indirection-expr"><span class="secno">6.16. </span><span class="content">Indirection Expression</span><a class="self-link" href="#indirection-expr"></a></h3>
<p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="indirection">indirection</dfn> operator converts a pointer to its corresponding reference.</p>
Expand Down Expand Up @@ -7891,7 +7892,7 @@ <h3 class="heading settled" data-level="9.3" id="shader-interface"><span class="
<p>the result value of the entry point</p>
<li data-md>
<p>all <a data-link-type="dfn" href="#module-scope" id="ref-for-module-scope①①">module scope</a> variables that are <a data-link-type="dfn" href="#statically-accessed" id="ref-for-statically-accessed①">statically accessed</a> by <a data-link-type="dfn" href="#functions-in-a-shader-stage" id="ref-for-functions-in-a-shader-stage②">functions in the shader stage</a>,
and which are in storage classes <a data-link-type="dfn" href="#storage-classes-uniform" id="ref-for-storage-classes-uniform⑨">uniform</a>, <a data-link-type="dfn" href="#storage-classes-storage" id="ref-for-storage-classes-storage①②">storage</a>, or <a data-link-type="dfn" href="#storage-classes-handle" id="ref-for-storage-classes-handle">handle</a>.</p>
and which are in storage classes <a data-link-type="dfn" href="#storage-classes-uniform" id="ref-for-storage-classes-uniform⑨">uniform</a>, <a data-link-type="dfn" href="#storage-classes-storage" id="ref-for-storage-classes-storage①②">storage</a>, or <a data-link-type="dfn" href="#storage-classes-handle" id="ref-for-storage-classes-handle">handle</a>.</p>
</ul>
<h4 class="heading settled" data-level="9.3.1" id="pipeline-inputs-outputs"><span class="secno">9.3.1. </span><span class="content">Pipeline Input and Output Interface</span><a class="self-link" href="#pipeline-inputs-outputs"></a></h4>
<p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="entry-point-io-type">Entry point IO type</dfn>s include the following:</p>
Expand Down Expand Up @@ -10102,7 +10103,7 @@ <h4 class="heading settled" data-level="16.8.6" id="texturesample"><span class="
<td> The optional texel offset applied to the unnormalized texture coordinate
before sampling the texture. This offset is applied before applying any
texture wrapping modes.<br> The <code>offset</code> expression must be a <code>const_expression</code> expression (e.g. <code>vec2&lt;i32>(1, 2)</code>).<br> Each <code>offset</code> component must be at least <code>-8</code> and at most <code>7</code>. Values outside
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
</table>
<p><strong>Returns:</strong></p>
<p>The sampled value.</p>
Expand Down Expand Up @@ -10142,7 +10143,7 @@ <h4 class="heading settled" data-level="16.8.7" id="texturesamplebias"><span cla
<td> The optional texel offset applied to the unnormalized texture coordinate
before sampling the texture. This offset is applied before applying any
texture wrapping modes.<br> The <code>offset</code> expression must be a <code>const_expression</code> expression (e.g. <code>vec2&lt;i32>(1, 2)</code>).<br> Each <code>offset</code> component must be at least <code>-8</code> and at most <code>7</code>. Values outside
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
</table>
<p><strong>Returns:</strong></p>
<p>The sampled value.</p>
Expand Down Expand Up @@ -10180,7 +10181,7 @@ <h4 class="heading settled" data-level="16.8.8" id="texturesamplecompare"><span
<td> The optional texel offset applied to the unnormalized texture coordinate
before sampling the texture. This offset is applied before applying any
texture wrapping modes.<br> The <code>offset</code> expression must be a <code>const_expression</code> expression (e.g. <code>vec2&lt;i32>(1, 2)</code>).<br> Each <code>offset</code> component must be at least <code>-8</code> and at most <code>7</code>. Values outside
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
</table>
<p><strong>Returns:</strong></p>
<p>A value in the range <code>[0.0..1.0]</code>.</p>
Expand Down Expand Up @@ -10248,7 +10249,7 @@ <h4 class="heading settled" data-level="16.8.10" id="texturesamplegrad"><span cl
<td> The optional texel offset applied to the unnormalized texture coordinate
before sampling the texture. This offset is applied before applying any
texture wrapping modes.<br> The <code>offset</code> expression must be a <code>const_expression</code> expression (e.g. <code>vec2&lt;i32>(1, 2)</code>).<br> Each <code>offset</code> component must be at least <code>-8</code> and at most <code>7</code>. Values outside
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
</table>
<p><strong>Returns:</strong></p>
<p>The sampled value.</p>
Expand Down Expand Up @@ -10296,7 +10297,7 @@ <h4 class="heading settled" data-level="16.8.11" id="texturesamplelevel"><span c
<td> The optional texel offset applied to the unnormalized texture coordinate
before sampling the texture. This offset is applied before applying any
texture wrapping modes.<br> The <code>offset</code> expression must be a <code>const_expression</code> expression (e.g. <code>vec2&lt;i32>(1, 2)</code>).<br> Each <code>offset</code> component must be at least <code>-8</code> and at most <code>7</code>. Values outside
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
of this range will result in a <a data-link-type="dfn" href="#shader-creation-error" id="ref-for-shader-creation-error">shader-creation error</a>.
</table>
<p><strong>Returns:</strong></p>
<p>The sampled value.</p>
Expand Down Expand Up @@ -10925,11 +10926,12 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
<aside class="dfn-panel" data-for="shader-creation-error">
<b><a href="#shader-creation-error">#shader-creation-error</a></b><b>Referenced in:</b>
<ul>
<li><a href="#ref-for-shader-creation-error">16.8.6. textureSample</a>
<li><a href="#ref-for-shader-creation-error①">16.8.7. textureSampleBias</a>
<li><a href="#ref-for-shader-creation-error②">16.8.8. textureSampleCompare</a>
<li><a href="#ref-for-shader-creation-error③">16.8.10. textureSampleGrad</a>
<li><a href="#ref-for-shader-creation-error④">16.8.11. textureSampleLevel</a>
<li><a href="#ref-for-shader-creation-error">6.15. Address-Of Expression</a>
<li><a href="#ref-for-shader-creation-error①">16.8.6. textureSample</a>
<li><a href="#ref-for-shader-creation-error②">16.8.7. textureSampleBias</a>
<li><a href="#ref-for-shader-creation-error③">16.8.8. textureSampleCompare</a>
<li><a href="#ref-for-shader-creation-error④">16.8.10. textureSampleGrad</a>
<li><a href="#ref-for-shader-creation-error⑤">16.8.11. textureSampleLevel</a>
</ul>
</aside>
<aside class="dfn-panel" data-for="attribute-align">
Expand Down Expand Up @@ -11484,7 +11486,8 @@ <h2 class="no-num no-ref heading settled" id="issues-index"><span class="content
<ul>
<li><a href="#ref-for-storage-classes-handle">4.5. Texture and Sampler Types</a>
<li><a href="#ref-for-storage-classes-handle①">5.1. Module Scope Variables</a>
<li><a href="#ref-for-storage-classes-handle②">9.3. Shader Interface</a>
<li><a href="#ref-for-storage-classes-handle②">6.15. Address-Of Expression</a>
<li><a href="#ref-for-storage-classes-handle③">9.3. Shader Interface</a>
</ul>
</aside>
<aside class="dfn-panel" data-for="alignof">
Expand Down

0 comments on commit 1415593

Please sign in to comment.