Skip to content

Commit

Permalink
Revert "Compatibility Mode, the easy part. (#488)" (#490)
Browse files Browse the repository at this point in the history
This reverts commit 0ce1ef2.
  • Loading branch information
kainino0x authored Jan 21, 2025
1 parent 0ce1ef2 commit 7dfbacd
Show file tree
Hide file tree
Showing 26 changed files with 26 additions and 78 deletions.
4 changes: 1 addition & 3 deletions sample/animometer/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/blending/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/cameras/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ gui.add(params, 'type', ['arcball', 'WASD']).onChange(() => {
oldCameraType = newCameraType;
});

const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
Expand Down
4 changes: 1 addition & 3 deletions sample/computeBoids/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ 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();
quitIfAdapterNotAvailable(adapter);

const hasTimestampQuery = adapter.features.has('timestamp-query');
Expand Down
4 changes: 1 addition & 3 deletions sample/fractalCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/gameOfLife/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/helloTriangle/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/helloTriangleMSAA/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/imageBlur/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/instancedCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/multipleCanvases/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ function createVertexAndIndexBuffer(
};
}

const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/normalMap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ enum TextureAtlas {
}

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
Expand Down
4 changes: 1 addition & 3 deletions sample/occlusionQuery/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ export type TypedArrayConstructor =

const info = document.querySelector('#info');

const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/points/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ function createFibonacciSphereVertices({
return new Float32Array(vertices);
}

const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/renderBundles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ interface Renderable {
}

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const adapter = await navigator.gpu?.requestAdapter({
featureLevel: 'compatibility',
});
const adapter = await navigator.gpu?.requestAdapter();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/resizeCanvas/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/resizeObserverHDDPI/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/rotatingCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/shadowMapping/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/texturedCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/transparentCanvas/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/twoCubes/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/videoUploading/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

Expand Down
4 changes: 1 addition & 3 deletions sample/volumeRenderingTexture3D/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
Expand Down
4 changes: 1 addition & 3 deletions sample/worker/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ 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();
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu');
Expand Down
4 changes: 1 addition & 3 deletions sample/workloadSimulator/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -586,9 +586,7 @@ <h2><center>Web graphics workload simulator</center></h2>
try {
if (deviceRequested) return;
deviceRequested = true;
let adapter = await navigator.gpu.requestAdapter({
featureLevel: 'compatibility',
});
let adapter = await navigator.gpu.requestAdapter();
featuresAndLimits.textContent = JSON.stringify(
{
name: adapter.name,
Expand Down

0 comments on commit 7dfbacd

Please sign in to comment.