From 19c5ebf5b086288d0db3a0c66557fd9b926637f2 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Thu, 26 Oct 2023 19:34:35 +0900 Subject: [PATCH] remove `any` from samples --- src/sample/animometer/main.ts | 2 +- src/sample/bitonicSort/utils.ts | 18 +++++++++--------- src/sample/computeBoids/main.ts | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sample/animometer/main.ts b/src/sample/animometer/main.ts index b11d405c..1b92c07c 100644 --- a/src/sample/animometer/main.ts +++ b/src/sample/animometer/main.ts @@ -283,7 +283,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { const renderPassDescriptor = { colorAttachments: [ { - view: undefined as any, // Assigned later + view: undefined as GPUTextureView, // Assigned later clearValue: { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }, loadOp: 'clear' as const, storeOp: 'store' as const, diff --git a/src/sample/bitonicSort/utils.ts b/src/sample/bitonicSort/utils.ts index fea2992f..764335a7 100644 --- a/src/sample/bitonicSort/utils.ts +++ b/src/sample/bitonicSort/utils.ts @@ -38,11 +38,11 @@ export const createBindGroupDescriptor = ( ): BindGroupsObjectsAndLayout => { const layoutEntries: GPUBindGroupLayoutEntry[] = []; for (let i = 0; i < bindings.length; i++) { - const layoutEntry: any = {}; - layoutEntry.binding = bindings[i]; - layoutEntry.visibility = visibilities[i % visibilities.length]; - layoutEntry[resourceTypes[i]] = resourceLayouts[i]; - layoutEntries.push(layoutEntry); + layoutEntries.push({ + binding: bindings[i], + visibility: visibilities[i % visibilities.length], + [resourceTypes[i]]: resourceLayouts[i], + }); } const bindGroupLayout = device.createBindGroupLayout({ @@ -58,10 +58,10 @@ export const createBindGroupDescriptor = ( for (let i = 0; i < resources.length; i++) { const groupEntries: GPUBindGroupEntry[] = []; for (let j = 0; j < resources[0].length; j++) { - const groupEntry: any = {}; - groupEntry.binding = j; - groupEntry.resource = resources[i][j]; - groupEntries.push(groupEntry); + groupEntries.push({ + binding: j, + resource: resources[i][j], + }); } const newBindGroup = device.createBindGroup({ label: `${label}.bindGroup${i}`, diff --git a/src/sample/computeBoids/main.ts b/src/sample/computeBoids/main.ts index ae8db740..4e8ee909 100644 --- a/src/sample/computeBoids/main.ts +++ b/src/sample/computeBoids/main.ts @@ -89,7 +89,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { const renderPassDescriptor = { colorAttachments: [ { - view: undefined as any, // Assigned later + view: undefined as GPUTextureView, // Assigned later clearValue: { r: 0.0, g: 0.0, b: 0.0, a: 1.0 }, loadOp: 'clear' as const, storeOp: 'store' as const,