Skip to content

Commit

Permalink
Deploying to gh-pages from @ 113a369 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Jul 9, 2024
1 parent 32b190e commit ae297b8
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 33 deletions.
4 changes: 2 additions & 2 deletions dist/1.x/typed-arrays.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
export type TypedArrayConstructor = Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor;
export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;
export declare class TypedArrayViewGenerator {
arrayBuffer: ArrayBuffer;
byteOffset: number;
Expand Down
2 changes: 1 addition & 1 deletion dist/1.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/1.x/webgpu-utils.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/1.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/1.x/webgpu-utils.module.js.map

Large diffs are not rendered by default.

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/types/TypedArray.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<li><a href="../modules.html">webgpu-utils</a></li>
<li><a href="TypedArray.html">TypedArray</a></li></ul>
<h1>Type alias TypedArray</h1></div>
<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>
<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>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion docs/types/TypedArrayConstructor.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<li><a href="../modules.html">webgpu-utils</a></li>
<li><a href="TypedArrayConstructor.html">TypedArrayConstructor</a></li></ul>
<h1>Type alias TypedArrayConstructor</h1></div>
<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>
<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>
<div class="col-sidebar">
<div class="page-menu">
<div class="tsd-navigation settings">
Expand Down
2 changes: 1 addition & 1 deletion 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 1.9.1 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
@license webgpu-utils 1.9.2 Copyright (c) 2023, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/webgpu-utils for details
-->
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgpu-utils",
"version": "1.9.1",
"version": "1.9.2",
"description": "webgpu utilities",
"main": "dist/1.x/webgpu-utils.module.js",
"module": "dist/1.x/webgpu-utils.module.js",
Expand Down
2 changes: 2 additions & 0 deletions src/typed-arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
export type TypedArrayConstructor =
| Int8ArrayConstructor
| Uint8ArrayConstructor
| Uint8ClampedArrayConstructor
| Int16ArrayConstructor
| Uint16ArrayConstructor
| Int32ArrayConstructor
Expand All @@ -15,6 +16,7 @@ export type TypedArrayConstructor =
export type TypedArray =
| Int8Array
| Uint8Array
| Uint8ClampedArray
| Int16Array
| Uint16Array
| Int32Array
Expand Down
37 changes: 23 additions & 14 deletions test/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
/* global mocha */
import './tests/buffer-views-test.js';
import './tests/data-definition-test.js';
import './tests/generate-mipmap-test.js';
import './tests/attribute-utils-test.js';
import './tests/texture-utils-test.js';
import {getInfo} from './tests/gpu-info.js';

const settings = typeof window === 'undefined' ? {} : Object.fromEntries(new URLSearchParams(window.location.search).entries());
if (settings.reporter) {
mocha.reporter(settings.reporter);
}
if (settings.grep) {
mocha.grep(new RegExp(settings.grep, 'i'), false);
async function main() {
const settings = typeof window === 'undefined' ? {} : Object.fromEntries(new URLSearchParams(window.location.search).entries());
if (settings.reporter) {
mocha.reporter(settings.reporter);
}
if (settings.grep) {
mocha.grep(new RegExp(settings.grep, 'i'), false);
}

await getInfo();
await Promise.all([
import('./tests/buffer-views-test.js'),
import('./tests/data-definition-test.js'),
import('./tests/generate-mipmap-test.js'),
import('./tests/attribute-utils-test.js'),
import('./tests/texture-utils-test.js'),
]);

mocha.run((failures) => {
window.testsPromiseInfo.resolve(failures);
});
}

mocha.run((failures) => {
window.testsPromiseInfo.resolve(failures);
});
main();
20 changes: 15 additions & 5 deletions test/puppeteer.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function getExamples(port) {
.map(f => ({
url: `http://localhost:${port}/examples/${f}`,
js: exampleInjectJS,
screenshot: true,
}));
}

Expand Down Expand Up @@ -71,12 +72,12 @@ async function test(port) {
...getExamples(port),
];

for (const {url, js} of testPages) {
for (const {url, js, screenshot} of testPages) {
waitingPromiseInfo = makePromiseInfo();
console.log(`===== [ ${url} ] =====`);
if (js) {
await page.evaluateOnNewDocument(js);
}
const id = js
? await page.evaluateOnNewDocument(js)
: undefined;
await page.goto(url);
await page.waitForNetworkIdle();
if (js) {
Expand All @@ -87,9 +88,18 @@ async function test(port) {
});
}
await waitingPromiseInfo.promise;
if (screenshot) {
const dir = 'screenshots';
fs.mkdirSync(dir, { recursive: true });
const name = /\/([a-z0-9_-]+).html/.exec(url)[1];
const path = `${dir}/${name}.png`;
await page.screenshot({path});
}
if (js) {
await page.removeScriptToEvaluateOnNewDocument(id.identifier);
}
}


await browser.close();
server.close();

Expand Down
22 changes: 22 additions & 0 deletions test/tests/gpu-info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { describe, it } from '../mocha-support.js';

function objLikeToObj(objLike) {
const obj = {};
for (const k in objLike) {
obj[k] = objLike[k];
}
return obj;
}

export async function getInfo() {
const adapter = await navigator.gpu.requestAdapter();
const title = JSON.stringify({
gpu: objLikeToObj(adapter?.info || await adapter?.requestAdapterInfo() || { webgpuError: 'no info' }),
userAgentData: JSON.parse(JSON.stringify(navigator.userAgentData || { userAgentData: 'none' })),
}, null, 2);

describe('gpu info', () => {
it(title, () => {});
});
}

0 comments on commit ae297b8

Please sign in to comment.