diff --git a/sample/animometer/main.ts b/sample/animometer/main.ts index 1d583640..4d45b2a3 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(); +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 17fce9cd..59b41388 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(); +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 7a7791e6..dcd2fdef 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(); +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 048d18fc..f74b2a84 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(); +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 ed308527..c6f98e73 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(); +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 0faaa424..363485e4 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(); +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 209f675b..81e75d80 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(); +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 b200a69b..e8783292 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(); +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 8d27f3ab..0406c7e2 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(); +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 333738ec..ab51cf89 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(); +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 8b3501be..8e2ccec9 100644 --- a/sample/multipleCanvases/main.ts +++ b/sample/multipleCanvases/main.ts @@ -46,7 +46,9 @@ function createVertexAndIndexBuffer( }; } -const adapter = await navigator.gpu?.requestAdapter(); +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 d23eaca6..253ab69b 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(); +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 60a425a2..5df06ec4 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(); +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 3d0b4349..fc48775b 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(); +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 5aec8124..1232d994 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(); +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 4ae6c782..1d5dc674 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(); +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 9e0f72f3..65eef702 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(); +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 0c61305a..ccdf5685 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(); +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 a748a915..dc5069db 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(); +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 9816e4be..cefbf80b 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(); +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 56b2d72e..d67d0f80 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(); +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 09178287..6bd9bfe5 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(); +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 e341e89c..8e37fcad 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(); +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 5f8d0c4a..581659d1 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(); +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 42f89e5d..0be8298a 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(); + 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 b82c22bd..ce8933bc 100644 --- a/sample/workloadSimulator/index.html +++ b/sample/workloadSimulator/index.html @@ -586,7 +586,9 @@