Skip to content

Commit ae297b8

Browse files
committed
Deploying to gh-pages from @ 113a369 🚀
1 parent 32b190e commit ae297b8

16 files changed

+76
-33
lines changed

dist/1.x/typed-arrays.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
2-
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
1+
export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
2+
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
33
export declare class TypedArrayViewGenerator {
44
arrayBuffer: ArrayBuffer;
55
byteOffset: number;

dist/1.x/webgpu-utils.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1.x/webgpu-utils.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1.x/webgpu-utils.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1.x/webgpu-utils.module.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1.x/webgpu-utils.module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1.x/webgpu-utils.module.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/types/TypedArray.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<li><a href="../modules.html">webgpu-utils</a></li>
1616
<li><a href="TypedArray.html">TypedArray</a></li></ul>
1717
<h1>Type alias TypedArray</h1></div>
18-
<div class="tsd-signature"><span class="tsd-kind-type-alias">Typed<wbr/>Array</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Int8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int16Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint16Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float64Array</span></div></div>
18+
<div class="tsd-signature"><span class="tsd-kind-type-alias">Typed<wbr/>Array</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Int8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8ClampedArray</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int16Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint16Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float32Array</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float64Array</span></div></div>
1919
<div class="col-sidebar">
2020
<div class="page-menu">
2121
<div class="tsd-navigation settings">

docs/types/TypedArrayConstructor.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<li><a href="../modules.html">webgpu-utils</a></li>
1616
<li><a href="TypedArrayConstructor.html">TypedArrayConstructor</a></li></ul>
1717
<h1>Type alias TypedArrayConstructor</h1></div>
18-
<div class="tsd-signature"><span class="tsd-kind-type-alias">Typed<wbr/>Array<wbr/>Constructor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Int8ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int16ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint16ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float64ArrayConstructor</span></div></div>
18+
<div class="tsd-signature"><span class="tsd-kind-type-alias">Typed<wbr/>Array<wbr/>Constructor</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type ">Int8ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint8ClampedArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int16ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint16ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Int32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Uint32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float32ArrayConstructor</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type ">Float64ArrayConstructor</span></div></div>
1919
<div class="col-sidebar">
2020
<div class="page-menu">
2121
<div class="tsd-navigation settings">

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
22
<!-- this file is auto-generated from README.md. Do not edited directly -->
33
<!--
4-
@license webgpu-utils 1.9.1 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
4+
@license webgpu-utils 1.9.2 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
55
Available via the MIT license.
66
see: http://github.com/greggman/webgpu-utils for details
77
-->

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webgpu-utils",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"description": "webgpu utilities",
55
"main": "dist/1.x/webgpu-utils.module.js",
66
"module": "dist/1.x/webgpu-utils.module.js",

src/typed-arrays.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
export type TypedArrayConstructor =
66
| Int8ArrayConstructor
77
| Uint8ArrayConstructor
8+
| Uint8ClampedArrayConstructor
89
| Int16ArrayConstructor
910
| Uint16ArrayConstructor
1011
| Int32ArrayConstructor
@@ -15,6 +16,7 @@ export type TypedArrayConstructor =
1516
export type TypedArray =
1617
| Int8Array
1718
| Uint8Array
19+
| Uint8ClampedArray
1820
| Int16Array
1921
| Uint16Array
2022
| Int32Array

test/index.js

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
/* global mocha */
2-
import './tests/buffer-views-test.js';
3-
import './tests/data-definition-test.js';
4-
import './tests/generate-mipmap-test.js';
5-
import './tests/attribute-utils-test.js';
6-
import './tests/texture-utils-test.js';
2+
import {getInfo} from './tests/gpu-info.js';
73

8-
const settings = typeof window === 'undefined' ? {} : Object.fromEntries(new URLSearchParams(window.location.search).entries());
9-
if (settings.reporter) {
10-
mocha.reporter(settings.reporter);
11-
}
12-
if (settings.grep) {
13-
mocha.grep(new RegExp(settings.grep, 'i'), false);
4+
async function main() {
5+
const settings = typeof window === 'undefined' ? {} : Object.fromEntries(new URLSearchParams(window.location.search).entries());
6+
if (settings.reporter) {
7+
mocha.reporter(settings.reporter);
8+
}
9+
if (settings.grep) {
10+
mocha.grep(new RegExp(settings.grep, 'i'), false);
11+
}
12+
13+
await getInfo();
14+
await Promise.all([
15+
import('./tests/buffer-views-test.js'),
16+
import('./tests/data-definition-test.js'),
17+
import('./tests/generate-mipmap-test.js'),
18+
import('./tests/attribute-utils-test.js'),
19+
import('./tests/texture-utils-test.js'),
20+
]);
21+
22+
mocha.run((failures) => {
23+
window.testsPromiseInfo.resolve(failures);
24+
});
1425
}
1526

16-
mocha.run((failures) => {
17-
window.testsPromiseInfo.resolve(failures);
18-
});
27+
main();

test/puppeteer.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function getExamples(port) {
3232
.map(f => ({
3333
url: `http://localhost:${port}/examples/${f}`,
3434
js: exampleInjectJS,
35+
screenshot: true,
3536
}));
3637
}
3738

@@ -71,12 +72,12 @@ async function test(port) {
7172
...getExamples(port),
7273
];
7374

74-
for (const {url, js} of testPages) {
75+
for (const {url, js, screenshot} of testPages) {
7576
waitingPromiseInfo = makePromiseInfo();
7677
console.log(`===== [ ${url} ] =====`);
77-
if (js) {
78-
await page.evaluateOnNewDocument(js);
79-
}
78+
const id = js
79+
? await page.evaluateOnNewDocument(js)
80+
: undefined;
8081
await page.goto(url);
8182
await page.waitForNetworkIdle();
8283
if (js) {
@@ -87,9 +88,18 @@ async function test(port) {
8788
});
8889
}
8990
await waitingPromiseInfo.promise;
91+
if (screenshot) {
92+
const dir = 'screenshots';
93+
fs.mkdirSync(dir, { recursive: true });
94+
const name = /\/([a-z0-9_-]+).html/.exec(url)[1];
95+
const path = `${dir}/${name}.png`;
96+
await page.screenshot({path});
97+
}
98+
if (js) {
99+
await page.removeScriptToEvaluateOnNewDocument(id.identifier);
100+
}
90101
}
91102

92-
93103
await browser.close();
94104
server.close();
95105

test/tests/gpu-info.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { describe, it } from '../mocha-support.js';
2+
3+
function objLikeToObj(objLike) {
4+
const obj = {};
5+
for (const k in objLike) {
6+
obj[k] = objLike[k];
7+
}
8+
return obj;
9+
}
10+
11+
export async function getInfo() {
12+
const adapter = await navigator.gpu.requestAdapter();
13+
const title = JSON.stringify({
14+
gpu: objLikeToObj(adapter?.info || await adapter?.requestAdapterInfo() || { webgpuError: 'no info' }),
15+
userAgentData: JSON.parse(JSON.stringify(navigator.userAgentData || { userAgentData: 'none' })),
16+
}, null, 2);
17+
18+
describe('gpu info', () => {
19+
it(title, () => {});
20+
});
21+
}
22+

0 commit comments

Comments
 (0)