From e7259567016a16be1ca6c0f4944025c40088adf1 Mon Sep 17 00:00:00 2001 From: Stephen White Date: Fri, 17 Jan 2025 11:03:07 -0500 Subject: [PATCH] Reformat. --- sample/animometer/main.ts | 4 +++- sample/blending/main.ts | 4 +++- sample/cameras/main.ts | 4 +++- sample/computeBoids/main.ts | 4 +++- sample/fractalCube/main.ts | 4 +++- sample/gameOfLife/main.ts | 4 +++- sample/helloTriangle/main.ts | 4 +++- sample/helloTriangleMSAA/main.ts | 4 +++- sample/imageBlur/main.ts | 4 +++- sample/instancedCube/main.ts | 4 +++- sample/multipleCanvases/main.ts | 4 +++- sample/normalMap/main.ts | 4 +++- sample/occlusionQuery/main.ts | 4 +++- sample/points/main.ts | 4 +++- sample/renderBundles/main.ts | 4 +++- sample/resizeCanvas/main.ts | 4 +++- sample/resizeObserverHDDPI/main.ts | 4 +++- sample/rotatingCube/main.ts | 4 +++- sample/shadowMapping/main.ts | 4 +++- sample/texturedCube/main.ts | 4 +++- sample/transparentCanvas/main.ts | 4 +++- sample/twoCubes/main.ts | 4 +++- sample/videoUploading/main.ts | 4 +++- sample/volumeRenderingTexture3D/main.ts | 4 +++- sample/worker/worker.ts | 4 +++- sample/workloadSimulator/index.html | 4 +++- 26 files changed, 78 insertions(+), 26 deletions(-) diff --git a/sample/animometer/main.ts b/sample/animometer/main.ts index ae7a8127..cdca4fa2 100644 --- a/sample/animometer/main.ts +++ b/sample/animometer/main.ts @@ -3,7 +3,9 @@ import animometerWGSL from './animometer.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/blending/main.ts b/sample/blending/main.ts index d76695cb..6556dfb5 100644 --- a/sample/blending/main.ts +++ b/sample/blending/main.ts @@ -3,7 +3,9 @@ import { GUI } from 'dat.gui'; import { quitIfWebGPUNotAvailable } from '../util'; import texturedQuadWGSL from './texturedQuad.wgsl'; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/cameras/main.ts b/sample/cameras/main.ts index f0d3b649..86a5fbd8 100644 --- a/sample/cameras/main.ts +++ b/sample/cameras/main.ts @@ -40,7 +40,9 @@ gui.add(params, 'type', ['arcball', 'WASD']).onChange(() => { oldCameraType = newCameraType; }); -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); const context = canvas.getContext('webgpu') as GPUCanvasContext; diff --git a/sample/computeBoids/main.ts b/sample/computeBoids/main.ts index f86aea6e..24c58217 100644 --- a/sample/computeBoids/main.ts +++ b/sample/computeBoids/main.ts @@ -4,7 +4,9 @@ import updateSpritesWGSL from './updateSprites.wgsl'; import { GUI } from 'dat.gui'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); quitIfAdapterNotAvailable(adapter); const hasTimestampQuery = adapter.features.has('timestamp-query'); diff --git a/sample/fractalCube/main.ts b/sample/fractalCube/main.ts index 1bfc842d..91d68c07 100644 --- a/sample/fractalCube/main.ts +++ b/sample/fractalCube/main.ts @@ -13,7 +13,9 @@ import sampleSelfWGSL from './sampleSelf.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/gameOfLife/main.ts b/sample/gameOfLife/main.ts index a2a5a56d..8f87ae4b 100644 --- a/sample/gameOfLife/main.ts +++ b/sample/gameOfLife/main.ts @@ -5,7 +5,9 @@ import fragWGSL from './frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/helloTriangle/main.ts b/sample/helloTriangle/main.ts index 367b64e2..a88dfd2c 100644 --- a/sample/helloTriangle/main.ts +++ b/sample/helloTriangle/main.ts @@ -3,7 +3,9 @@ import redFragWGSL from '../../shaders/red.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/helloTriangleMSAA/main.ts b/sample/helloTriangleMSAA/main.ts index bde43871..63a677c0 100644 --- a/sample/helloTriangleMSAA/main.ts +++ b/sample/helloTriangleMSAA/main.ts @@ -3,7 +3,9 @@ import redFragWGSL from '../../shaders/red.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/imageBlur/main.ts b/sample/imageBlur/main.ts index 2081625c..567229c2 100644 --- a/sample/imageBlur/main.ts +++ b/sample/imageBlur/main.ts @@ -8,7 +8,9 @@ const tileDim = 128; const batch = [4, 4]; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/instancedCube/main.ts b/sample/instancedCube/main.ts index 90c44f79..9a4f0f36 100644 --- a/sample/instancedCube/main.ts +++ b/sample/instancedCube/main.ts @@ -13,7 +13,9 @@ import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/multipleCanvases/main.ts b/sample/multipleCanvases/main.ts index c0b904d8..1ee07059 100644 --- a/sample/multipleCanvases/main.ts +++ b/sample/multipleCanvases/main.ts @@ -46,7 +46,9 @@ function createVertexAndIndexBuffer( }; } -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/normalMap/main.ts b/sample/normalMap/main.ts index 57c9df7d..7ede5441 100644 --- a/sample/normalMap/main.ts +++ b/sample/normalMap/main.ts @@ -18,7 +18,9 @@ enum TextureAtlas { } const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); const context = canvas.getContext('webgpu') as GPUCanvasContext; diff --git a/sample/occlusionQuery/main.ts b/sample/occlusionQuery/main.ts index 3fcda3e8..13a0c8dd 100644 --- a/sample/occlusionQuery/main.ts +++ b/sample/occlusionQuery/main.ts @@ -31,7 +31,9 @@ export type TypedArrayConstructor = const info = document.querySelector('#info'); -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/points/main.ts b/sample/points/main.ts index b079f603..0d2a9ed4 100644 --- a/sample/points/main.ts +++ b/sample/points/main.ts @@ -29,7 +29,9 @@ function createFibonacciSphereVertices({ return new Float32Array(vertices); } -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/renderBundles/main.ts b/sample/renderBundles/main.ts index 58abb01f..5222b56d 100644 --- a/sample/renderBundles/main.ts +++ b/sample/renderBundles/main.ts @@ -14,7 +14,9 @@ interface Renderable { } const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/resizeCanvas/main.ts b/sample/resizeCanvas/main.ts index 629e4966..f5765a60 100644 --- a/sample/resizeCanvas/main.ts +++ b/sample/resizeCanvas/main.ts @@ -3,7 +3,9 @@ import redFragWGSL from '../../shaders/red.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/resizeObserverHDDPI/main.ts b/sample/resizeObserverHDDPI/main.ts index b5b5bc4e..1b648cc0 100644 --- a/sample/resizeObserverHDDPI/main.ts +++ b/sample/resizeObserverHDDPI/main.ts @@ -3,7 +3,9 @@ import checkerWGSL from './checker.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/rotatingCube/main.ts b/sample/rotatingCube/main.ts index 1534ee53..386e24d3 100644 --- a/sample/rotatingCube/main.ts +++ b/sample/rotatingCube/main.ts @@ -13,7 +13,9 @@ import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/shadowMapping/main.ts b/sample/shadowMapping/main.ts index 0f7f5237..eec0b727 100644 --- a/sample/shadowMapping/main.ts +++ b/sample/shadowMapping/main.ts @@ -9,7 +9,9 @@ import { quitIfWebGPUNotAvailable } from '../util'; const shadowDepthTextureSize = 1024; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/texturedCube/main.ts b/sample/texturedCube/main.ts index c4ea82d6..c71db7a0 100644 --- a/sample/texturedCube/main.ts +++ b/sample/texturedCube/main.ts @@ -13,7 +13,9 @@ import sampleTextureMixColorWGSL from './sampleTextureMixColor.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/transparentCanvas/main.ts b/sample/transparentCanvas/main.ts index 7dcc7778..f003d4f6 100644 --- a/sample/transparentCanvas/main.ts +++ b/sample/transparentCanvas/main.ts @@ -13,7 +13,9 @@ import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/twoCubes/main.ts b/sample/twoCubes/main.ts index dd8a10f3..81d5f18b 100644 --- a/sample/twoCubes/main.ts +++ b/sample/twoCubes/main.ts @@ -13,7 +13,9 @@ import vertexPositionColorWGSL from '../../shaders/vertexPositionColor.frag.wgsl import { quitIfWebGPUNotAvailable } from '../util'; const canvas = document.querySelector('canvas') as HTMLCanvasElement; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/videoUploading/main.ts b/sample/videoUploading/main.ts index 815b5aaf..1fa317e5 100644 --- a/sample/videoUploading/main.ts +++ b/sample/videoUploading/main.ts @@ -3,7 +3,9 @@ import fullscreenTexturedQuadWGSL from '../../shaders/fullscreenTexturedQuad.wgs import sampleExternalTextureWGSL from '../../shaders/sampleExternalTexture.frag.wgsl'; import { quitIfWebGPUNotAvailable } from '../util'; -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); diff --git a/sample/volumeRenderingTexture3D/main.ts b/sample/volumeRenderingTexture3D/main.ts index 78b2a25b..fcb46ea0 100644 --- a/sample/volumeRenderingTexture3D/main.ts +++ b/sample/volumeRenderingTexture3D/main.ts @@ -18,7 +18,9 @@ gui.add(params, 'rotateCamera', true); gui.add(params, 'near', 2.0, 7.0); gui.add(params, 'far', 2.0, 7.0); -const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); +const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' +}); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); const context = canvas.getContext('webgpu') as GPUCanvasContext; diff --git a/sample/worker/worker.ts b/sample/worker/worker.ts index 4d84c795..f03cf3f6 100644 --- a/sample/worker/worker.ts +++ b/sample/worker/worker.ts @@ -35,7 +35,9 @@ self.addEventListener('message', (ev) => { // to the init() method for all the other samples. The remainder of this file is largely identical // to the rotatingCube sample. async function init(canvas) { - const adapter = await navigator.gpu?.requestAdapter({ featureLevel: 'compatibility' }); + const adapter = await navigator.gpu?.requestAdapter({ + featureLevel: 'compatibility' + }); const device = await adapter?.requestDevice(); quitIfWebGPUNotAvailable(adapter, device); const context = canvas.getContext('webgpu'); diff --git a/sample/workloadSimulator/index.html b/sample/workloadSimulator/index.html index 03cbabb6..b1de4d56 100644 --- a/sample/workloadSimulator/index.html +++ b/sample/workloadSimulator/index.html @@ -586,7 +586,9 @@

Web graphics workload simulator

try { if (deviceRequested) return; deviceRequested = true; - let adapter = await navigator.gpu.requestAdapter({ featureLevel: 'compatibility' }); + let adapter = await navigator.gpu.requestAdapter({ + featureLevel: 'compatibility' + }); featuresAndLimits.textContent = JSON.stringify( { name: adapter.name,