Skip to content

Commit

Permalink
use webgpu-utils 1x
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Dec 22, 2023
1 parent 244bd78 commit e28a506
Show file tree
Hide file tree
Showing 54 changed files with 5,923 additions and 53 deletions.
5,870 changes: 5,870 additions & 0 deletions 3rdparty/webgpu-utils-1.x.module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/tests/data-byte-diagram-tests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { describe, it } from '../mocha-support.js';
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import { assertEqual } from '../assert.js';
import { getCodeForUniform } from '../../webgpu/lessons/resources/data-byte-diagram.js';

Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/ja/webgpu-memory-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ JavaScript側でオフセット値を書き換えて、つじつまを合わせ
import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js';
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils-1.x.module.js';
const code = `
struct Ex4a {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/ko/webgpu-memory-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ WGSL 코드를 제공하면 API가 이 모든 작업을 대신 수행합니다.
import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js';
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils-1.x.module.js';
const code = `
struct Ex4a {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/ko/webgpu-memory-layout_obsolete_kr.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ WGSL에서 데이터의 크기와 오프셋을 계산하는 부분이 아마 Web
import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js';
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils-1.x.module.js';
const code = `
struct Ex4a {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/byte-diagram-test.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import {
createByteDiagramForType,
getCodeForUniform,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/data-byte-diagram.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
makeStructuredView,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import typeInfo from './wgsl-data-types.js';
import {
createElem as el,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/resources/wgsl-offset-computer.html
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ <h1>WGSL Offset Computer</h1>
import {
makeShaderDataDefinitions,
setIntrinsicsToView,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import {
createByteDiagramForType,
getCodeForUniform,
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-matrix-math.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-memory-layout.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-memory-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ like this
import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js';
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils-1.x.module.js';
const code = `
struct Ex4a {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-orthographic-projection.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
import {
makeShaderDataDefinitions,
} from '/3rdparty/webgpu-utils.module.js';
} from '/3rdparty/webgpu-utils-1.x.module.js';
import {
renderDiagrams
} from './resources/diagrams.js';
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/webgpu-transparency.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
createElem as el
} from './resources/elem.js';
import {mat4} from '/3rdparty/wgpu-matrix.module.js';
import {createTextureFromSource} from '/3rdparty/webgpu-utils.module.js';
import {createTextureFromSource} from '/3rdparty/webgpu-utils-1.x.module.js';


const hsl = (h, s, l) => `hsl(${h * 360 | 0}, ${s * 100}%, ${l * 100 | 0}%)`;
Expand Down
2 changes: 1 addition & 1 deletion webgpu/lessons/zh_cn/webgpu-memory-layout.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ struct Ex4 {
import {
makeShaderDataDefinitions,
makeStructuredView,
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils.module.js';
} from 'https://greggman.github.io/webgpu-utils/dist/0.x/webgpu-utils-1.x.module.js';
const code = `
struct Ex4a {
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-blend-compare-to-canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#wgpu-matrix
import {mat4} from '/3rdparty/wgpu-matrix.module.js';
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import {createTextureFromSource} from '/3rdparty/webgpu-utils.module.js';
import {createTextureFromSource} from '/3rdparty/webgpu-utils-1.x.module.js';

const hsl = (h, s, l) => `hsl(${h * 360 | 0}, ${s * 100}%, ${l * 100 | 0}%)`;
const hsla = (h, s, l, a) => `hsla(${h * 360 | 0}, ${s * 100}%, ${l * 100 | 0}%, ${a})`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import { loadImageBitmap } from '../3rdparty/webgpu-utils.module.js';
import { loadImageBitmap } from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const imgBitmap = await loadImageBitmap('resources/images/pexels-chevanon-photography-1108099.jpg'); /* webgpufundamentals: url */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import { loadImageBitmap } from '../3rdparty/webgpu-utils.module.js';
import { loadImageBitmap } from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const imgBitmap = await loadImageBitmap('resources/images/pexels-chevanon-photography-1108099.jpg'); /* webgpufundamentals: url */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-4ch-optimized.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-4ch-slow.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-4ch-with-race.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import { loadImageBitmap } from '../3rdparty/webgpu-utils.module.js';
import { loadImageBitmap } from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const imgBitmap = await loadImageBitmap('resources/images/pexels-francesco-ungaro-96938-mid.jpg'); /* webgpufundamentals: url */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-invocations.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import { loadImageBitmap } from '../3rdparty/webgpu-utils.module.js';
import { loadImageBitmap } from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const imgBitmap = await loadImageBitmap('resources/images/pexels-francesco-ungaro-96938-mid.jpg'); /* webgpufundamentals: url */
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-javascript.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</body>
<script type="module">
// see https://webgpufundamentals.org/webgpu/lessons/webgpu-utils.html#webgpu-utils
import { loadImageBitmap } from '../3rdparty/webgpu-utils.module.js';
import { loadImageBitmap } from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const imgBitmap = await loadImageBitmap('resources/images/pexels-francesco-ungaro-96938-mid.jpg'); /* webgpufundamentals: url */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
2 changes: 1 addition & 1 deletion webgpu/webgpu-compute-shaders-histogram-optimized.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import {
loadImageBitmap,
createTextureFromSource,
} from '../3rdparty/webgpu-utils.module.js';
} from '../3rdparty/webgpu-utils-1.x.module.js';

async function main() {
const adapter = await navigator.gpu?.requestAdapter();
Expand Down
Loading

0 comments on commit e28a506

Please sign in to comment.