Skip to content

Commit

Permalink
Deploying to gh-pages from @ 09913d2 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Oct 19, 2023
1 parent f0814e8 commit 7b01251
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 42 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ uni2.set([
```

The reason it's this way is it's common to make large arrays of `f32`, `u32`,
`vec2f`, `vec3f`, `vec4f` etc. We couldn't want every element of an array to
`vec2f`, `vec3f`, `vec4f` etc. We wouldn't want every element of an array to
have its own typedarray view.

### arrays of intrinsics can be set by arrays of arrays
Expand Down
39 changes: 26 additions & 13 deletions dist/0.x/webgpu-utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/0.x/webgpu-utils.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/0.x/webgpu-utils.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/0.x/webgpu-utils.min.js.map

Large diffs are not rendered by default.

39 changes: 26 additions & 13 deletions dist/0.x/webgpu-utils.module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/0.x/webgpu-utils.module.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2>webgpu-utils</h2></div>
<pre><code class="language-js"><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">code</span><span class="hl-1"> = </span><span class="hl-3">`</span><br/><span class="hl-3">@group(0) @binding(0) var&lt;uniform&gt; uni1: array&lt;vec3f, 4&gt;;</span><br/><span class="hl-3">@group(0) @binding(1) var&lt;uniform&gt; uni2: array&lt;array&lt;vec3f, 3&gt;, 4&gt;;</span><br/><span class="hl-3">`</span><span class="hl-1">;</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">defs</span><span class="hl-1"> = </span><span class="hl-6">makeShaderDataDefinitions</span><span class="hl-1">(</span><span class="hl-2">code</span><span class="hl-1">);</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">uni1</span><span class="hl-1"> = </span><span class="hl-6">makeStructuredView</span><span class="hl-1">(</span><span class="hl-2">defs</span><span class="hl-1">.</span><span class="hl-2">uniforms</span><span class="hl-1">.</span><span class="hl-2">uni1</span><span class="hl-1">);</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">uni2</span><span class="hl-1"> = </span><span class="hl-6">makeStructuredView</span><span class="hl-1">(</span><span class="hl-2">defs</span><span class="hl-1">.</span><span class="hl-2">uniforms</span><span class="hl-1">.</span><span class="hl-2">uni2</span><span class="hl-1">);</span><br/><br/><span class="hl-2">uni1</span><span class="hl-1">.</span><span class="hl-6">set</span><span class="hl-1">([</span><br/><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-8">2</span><span class="hl-1">, </span><span class="hl-8">3</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni1[0]</span><br/><span class="hl-1"> </span><span class="hl-8">4</span><span class="hl-1">, </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-8">6</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni1[1]</span><br/><span class="hl-1"> </span><span class="hl-7">//...</span><br/><span class="hl-1">]);</span><br/><br/><span class="hl-2">uni2</span><span class="hl-1">.</span><span class="hl-6">set</span><span class="hl-1">([</span><br/><span class="hl-1"> [</span><br/><span class="hl-1"> </span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-8">2</span><span class="hl-1">, </span><span class="hl-8">3</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni2[0][0],</span><br/><span class="hl-1"> </span><span class="hl-8">4</span><span class="hl-1">, </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-8">6</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni2[0][1],</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1"> , </span><span class="hl-7">// uni2[1]</span><br/><span class="hl-1"> [</span><br/><span class="hl-1"> </span><span class="hl-8">7</span><span class="hl-1">, </span><span class="hl-8">8</span><span class="hl-1">, </span><span class="hl-8">9</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni2[2][0],</span><br/><span class="hl-1"> </span><span class="hl-8">4</span><span class="hl-1">, </span><span class="hl-8">5</span><span class="hl-1">, </span><span class="hl-8">6</span><span class="hl-1">, </span><span class="hl-8">0</span><span class="hl-1">, </span><span class="hl-7">// uni2[2][1],</span><br/><span class="hl-1"> ],</span><br/><span class="hl-1">]);</span>
</code><button>Copy</button></pre>
<p>The reason it&#39;s this way is it&#39;s common to make large arrays of <code>f32</code>, <code>u32</code>,
<code>vec2f</code>, <code>vec3f</code>, <code>vec4f</code> etc. We couldn&#39;t want every element of an array to
<code>vec2f</code>, <code>vec3f</code>, <code>vec4f</code> etc. We wouldn&#39;t want every element of an array to
have its own typedarray view.</p>
<a id="md:arrays-of-intrinsics-can-be-set-by-arrays-of-arrays" class="tsd-anchor"></a><h3><a href="#md:arrays-of-intrinsics-can-be-set-by-arrays-of-arrays">arrays of intrinsics can be set by arrays of arrays</a></h3><pre><code class="language-js"><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">code</span><span class="hl-1"> = </span><span class="hl-3">`</span><br/><span class="hl-3">@group(0) @binding(0) var&lt;uniform&gt; uni1: array&lt;vec2f, 4&gt;;</span><br/><span class="hl-3">`</span><span class="hl-1">;</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">defs</span><span class="hl-1"> = </span><span class="hl-6">makeShaderDataDefinitions</span><span class="hl-1">(</span><span class="hl-2">code</span><span class="hl-1">);</span><br/><span class="hl-4">const</span><span class="hl-1"> </span><span class="hl-5">uni1</span><span class="hl-1"> = </span><span class="hl-6">makeStructuredView</span><span class="hl-1">(</span><span class="hl-2">defs</span><span class="hl-1">.</span><span class="hl-2">uniforms</span><span class="hl-1">.</span><span class="hl-2">uni1</span><span class="hl-1">);</span><br/><br/><span class="hl-2">uni1</span><span class="hl-1">.</span><span class="hl-6">set</span><span class="hl-1">([</span><br/><span class="hl-1"> [</span><span class="hl-8">1</span><span class="hl-1">, </span><span class="hl-8">2</span><span class="hl-1">], </span><span class="hl-7">// uni1[0]</span><br/><span class="hl-1"> [</span><span class="hl-8">3</span><span class="hl-1">, </span><span class="hl-8">4</span><span class="hl-1">], </span><span class="hl-7">// uni1[1]</span><br/><span class="hl-1">]);</span>
</code><button>Copy</button></pre>
Expand Down
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!-- this file is auto-generated from README.md. Do not edited directly -->
<!--
@license webgpu-utils 0.13.1 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
@license webgpu-utils 0.14.0 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/webgpu-utils for details
-->
Expand Down Expand Up @@ -244,7 +244,7 @@ <h3>The first level of an array of intrinsic types is flattened.</h3>
]);
</code></pre>
<p>The reason it’s this way is it’s common to make large arrays of <code>f32</code>, <code>u32</code>,
<code>vec2f</code>, <code>vec3f</code>, <code>vec4f</code> etc. We couldn’t want every element of an array to
<code>vec2f</code>, <code>vec3f</code>, <code>vec4f</code> etc. We wouldn’t want every element of an array to
have its own typedarray view.</p>
<h3>arrays of intrinsics can be set by arrays of arrays</h3>
<pre><code class="lang-js">const code = `
Expand Down
14 changes: 8 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgpu-utils",
"version": "0.13.1",
"version": "0.14.0",
"description": "webgpu utilities",
"main": "dist/0.x/webgpu-utils.module.js",
"module": "dist/0.x/webgpu-utils.module.js",
Expand Down Expand Up @@ -63,6 +63,6 @@
"tslib": "^2.6.1",
"typedoc": "^0.24.8",
"typescript": "^5.1.6",
"wgsl_reflect": "github:brendan-duncan/wgsl_reflect#ffdb63c"
"wgsl_reflect": "github:brendan-duncan/wgsl_reflect#f1aee47f7367297531c889dbdb79b5e9e20b31af"
}
}

0 comments on commit 7b01251

Please sign in to comment.