Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sample/a-buffer/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const device = await adapter?.requestDevice({
});
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const presentationFormat = navigator.gpu.getPreferredCanvasFormat();

context.configure({
Expand Down
2 changes: 1 addition & 1 deletion sample/animometer/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const settings = {
dynamicOffsets: Boolean(params.get('dynamicOffsets')),
};

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/bitonicSort/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const SampleInitFactoryWebGPU = async (
});
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/cameras/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const adapter = await navigator.gpu?.requestAdapter({
});
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/computeBoids/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (canvas.parentNode) {
console.error('canvas.parentNode is null');
}

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/cornell/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
context.configure({
device,
format: presentationFormat,
Expand Down
2 changes: 1 addition & 1 deletion sample/cubemap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/deferredRendering/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const device = await adapter?.requestDevice({
});
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/fractalCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/gameOfLife/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/generateMipmap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const device = await adapter?.requestDevice({
quitIfWebGPUNotAvailable(adapter, device);

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/helloTriangle/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/helloTriangleMSAA/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/imageBlur/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/instancedCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/normalMap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const adapter = await navigator.gpu?.requestAdapter({
});
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/occlusionQuery/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/particles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/renderBundles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ gui.add(settings, 'asteroidCount', 1000, 10000, 1000).onChange(() => {
updateRenderBundle();
});

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/resizeCanvas/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const presentationFormat = navigator.gpu.getPreferredCanvasFormat();

Expand Down
2 changes: 1 addition & 1 deletion sample/resizeObserverHDDPI/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const presentationFormat = navigator.gpu.getPreferredCanvasFormat();

Expand Down
2 changes: 1 addition & 1 deletion sample/reversedZ/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/rotatingCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/samplerParameters/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ canvas.width = canvas.height = kCanvasSize;
canvas.style.minWidth = canvas.style.maxWidth = kCanvasCSSSize + 'px';
const presentationFormat = navigator.gpu.getPreferredCanvasFormat();

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
context.configure({
device,
format: presentationFormat,
Expand Down
2 changes: 1 addition & 1 deletion sample/shadowMapping/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/skinnedMesh/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const device = await adapter?.requestDevice({
});
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio || 1;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/textRenderingMsdf/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const device = await adapter?.requestDevice({
});
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio || 1;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/texturedCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/timestampQuery/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const timestampQueryManager = new TimestampQueryManager(device, (elapsedNs) => {

const renderPassDurationCounter = new PerfCounter();

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/transparentCanvas/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/twoCubes/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const adapter = await navigator.gpu?.requestAdapter({
const device = await adapter?.requestDevice();
quitIfWebGPUNotAvailable(adapter, device);

const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
Expand Down
2 changes: 1 addition & 1 deletion sample/videoUploading/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const videos = {
} as const;

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const presentationFormat = navigator.gpu.getPreferredCanvasFormat();

context.configure({
Expand Down
2 changes: 1 addition & 1 deletion sample/volumeRenderingTexture3D/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if (adapter?.features.has('texture-compression-astc-sliced-3d')) {
const device = await adapter?.requestDevice({ requiredFeatures });

quitIfWebGPUNotAvailable(adapter, device);
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');

const sampleCount = 4;

Expand Down
2 changes: 1 addition & 1 deletion sample/wireframe/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const device = await adapter?.requestDevice({
quitIfWebGPUNotAvailable(adapter, device);

const canvas = document.querySelector('canvas') as HTMLCanvasElement;
const context = canvas.getContext('webgpu') as GPUCanvasContext;
const context = canvas.getContext('webgpu');
const devicePixelRatio = window.devicePixelRatio;
canvas.width = canvas.clientWidth * devicePixelRatio;
canvas.height = canvas.clientHeight * devicePixelRatio;
Expand Down