diff --git a/sample/a-buffer/main.ts b/sample/a-buffer/main.ts index 9354b234..9241c76f 100644 --- a/sample/a-buffer/main.ts +++ b/sample/a-buffer/main.ts @@ -451,21 +451,15 @@ const configure = () => { entries: [ { binding: 0, - resource: { - buffer: uniformBuffer, - }, + resource: uniformBuffer, }, { binding: 1, - resource: { - buffer: headsBuffer, - }, + resource: headsBuffer, }, { binding: 2, - resource: { - buffer: linkedListBuffer, - }, + resource: linkedListBuffer, }, { binding: 3, @@ -487,21 +481,15 @@ const configure = () => { entries: [ { binding: 0, - resource: { - buffer: uniformBuffer, - }, + resource: uniformBuffer, }, { binding: 1, - resource: { - buffer: headsBuffer, - }, + resource: headsBuffer, }, { binding: 2, - resource: { - buffer: linkedListBuffer, - }, + resource: linkedListBuffer, }, { binding: 3, diff --git a/sample/blending/main.ts b/sample/blending/main.ts index 7444cb30..ac2e4ded 100644 --- a/sample/blending/main.ts +++ b/sample/blending/main.ts @@ -194,7 +194,7 @@ const srcBindGroupUnpremultipliedAlpha = device.createBindGroup({ entries: [ { binding: 0, resource: sampler }, { binding: 1, resource: srcTextureUnpremultipliedAlpha.createView() }, - { binding: 2, resource: { buffer: srcUniform.buffer } }, + { binding: 2, resource: srcUniform.buffer }, ], }); @@ -203,7 +203,7 @@ const dstBindGroupUnpremultipliedAlpha = device.createBindGroup({ entries: [ { binding: 0, resource: sampler }, { binding: 1, resource: dstTextureUnpremultipliedAlpha.createView() }, - { binding: 2, resource: { buffer: dstUniform.buffer } }, + { binding: 2, resource: dstUniform.buffer }, ], }); @@ -212,7 +212,7 @@ const srcBindGroupPremultipliedAlpha = device.createBindGroup({ entries: [ { binding: 0, resource: sampler }, { binding: 1, resource: srcTexturePremultipliedAlpha.createView() }, - { binding: 2, resource: { buffer: srcUniform.buffer } }, + { binding: 2, resource: srcUniform.buffer }, ], }); @@ -221,7 +221,7 @@ const dstBindGroupPremultipliedAlpha = device.createBindGroup({ entries: [ { binding: 0, resource: sampler }, { binding: 1, resource: dstTexturePremultipliedAlpha.createView() }, - { binding: 2, resource: { buffer: dstUniform.buffer } }, + { binding: 2, resource: dstUniform.buffer }, ], }); diff --git a/sample/cameras/main.ts b/sample/cameras/main.ts index 44685ea2..4b2b27aa 100644 --- a/sample/cameras/main.ts +++ b/sample/cameras/main.ts @@ -155,20 +155,9 @@ const sampler = device.createSampler({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: sampler, - }, - { - binding: 2, - resource: cubeTexture.createView(), - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: sampler }, + { binding: 2, resource: cubeTexture.createView() }, ], }); diff --git a/sample/computeBoids/main.ts b/sample/computeBoids/main.ts index 24c01098..c40cdf7f 100644 --- a/sample/computeBoids/main.ts +++ b/sample/computeBoids/main.ts @@ -231,28 +231,9 @@ for (let i = 0; i < 2; ++i) { particleBindGroups[i] = device.createBindGroup({ layout: computePipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: simParamBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: particleBuffers[i], - offset: 0, - size: initialParticleData.byteLength, - }, - }, - { - binding: 2, - resource: { - buffer: particleBuffers[(i + 1) % 2], - offset: 0, - size: initialParticleData.byteLength, - }, - }, + { binding: 0, resource: simParamBuffer }, + { binding: 1, resource: particleBuffers[i] }, + { binding: 2, resource: particleBuffers[(i + 1) % 2] }, ], }); } diff --git a/sample/cornell/common.ts b/sample/cornell/common.ts index 9233fd73..4b0f2587 100644 --- a/sample/cornell/common.ts +++ b/sample/cornell/common.ts @@ -55,20 +55,12 @@ export default class Common { { // common_uniforms binding: 0, - resource: { - buffer: this.uniformBuffer, - offset: 0, - size: this.uniformBuffer.size, - }, + resource: this.uniformBuffer, }, { // quads binding: 1, - resource: { - buffer: quads, - offset: 0, - size: quads.size, - }, + resource: quads, }, ], }); diff --git a/sample/cornell/radiosity.ts b/sample/cornell/radiosity.ts index 9645443c..c6e2c259 100644 --- a/sample/cornell/radiosity.ts +++ b/sample/cornell/radiosity.ts @@ -111,10 +111,7 @@ export default class Radiosity { { // accumulation buffer binding: 0, - resource: { - buffer: this.accumulationBuffer, - size: this.accumulationBuffer.size, - }, + resource: this.accumulationBuffer, }, { // lightmap @@ -124,10 +121,7 @@ export default class Radiosity { { // radiosity_uniforms binding: 2, - resource: { - buffer: this.uniformBuffer, - size: this.uniformBuffer.size, - }, + resource: this.uniformBuffer, }, ], }); diff --git a/sample/cubemap/main.ts b/sample/cubemap/main.ts index 32515192..28452a5f 100644 --- a/sample/cubemap/main.ts +++ b/sample/cubemap/main.ts @@ -158,11 +158,7 @@ const uniformBindGroup = device.createBindGroup({ entries: [ { binding: 0, - resource: { - buffer: uniformBuffer, - offset: 0, - size: uniformBufferSize, - }, + resource: uniformBuffer, }, { binding: 1, diff --git a/sample/deferredRendering/main.ts b/sample/deferredRendering/main.ts index dcf162a1..689d90d1 100644 --- a/sample/deferredRendering/main.ts +++ b/sample/deferredRendering/main.ts @@ -345,36 +345,17 @@ const cameraUniformBuffer = device.createBuffer({ const sceneUniformBindGroup = device.createBindGroup({ layout: writeGBuffersPipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: modelUniformBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: cameraUniformBuffer, - }, - }, + { binding: 0, resource: modelUniformBuffer }, + { binding: 1, resource: cameraUniformBuffer }, ], }); const gBufferTexturesBindGroup = device.createBindGroup({ layout: gBufferTexturesBindGroupLayout, entries: [ - { - binding: 0, - resource: gBufferTextureViews[0], - }, - { - binding: 1, - resource: gBufferTextureViews[1], - }, - { - binding: 2, - resource: gBufferTextureViews[2], - }, + { binding: 0, resource: gBufferTextureViews[0] }, + { binding: 1, resource: gBufferTextureViews[1] }, + { binding: 2, resource: gBufferTextureViews[2] }, ], }); @@ -445,21 +426,15 @@ const lightsBufferBindGroup = device.createBindGroup({ entries: [ { binding: 0, - resource: { - buffer: lightsBuffer, - }, + resource: lightsBuffer, }, { binding: 1, - resource: { - buffer: configUniformBuffer, - }, + resource: configUniformBuffer, }, { binding: 2, - resource: { - buffer: cameraUniformBuffer, - }, + resource: cameraUniformBuffer, }, ], }); @@ -468,21 +443,15 @@ const lightsBufferComputeBindGroup = device.createBindGroup({ entries: [ { binding: 0, - resource: { - buffer: lightsBuffer, - }, + resource: lightsBuffer, }, { binding: 1, - resource: { - buffer: configUniformBuffer, - }, + resource: configUniformBuffer, }, { binding: 2, - resource: { - buffer: lightExtentBuffer, - }, + resource: lightExtentBuffer, }, ], }); diff --git a/sample/fractalCube/main.ts b/sample/fractalCube/main.ts index a8f0987e..5220d160 100644 --- a/sample/fractalCube/main.ts +++ b/sample/fractalCube/main.ts @@ -127,20 +127,9 @@ const sampler = device.createSampler({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: sampler, - }, - { - binding: 2, - resource: cubeTexture.createView(), - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: sampler }, + { binding: 2, resource: cubeTexture.createView() }, ], }); diff --git a/sample/gameOfLife/main.ts b/sample/gameOfLife/main.ts index e12bddb6..8e3965a7 100644 --- a/sample/gameOfLife/main.ts +++ b/sample/gameOfLife/main.ts @@ -169,18 +169,18 @@ function resetGameData() { const bindGroup0 = device.createBindGroup({ layout: bindGroupLayoutCompute, entries: [ - { binding: 0, resource: { buffer: sizeBuffer } }, - { binding: 1, resource: { buffer: buffer0 } }, - { binding: 2, resource: { buffer: buffer1 } }, + { binding: 0, resource: sizeBuffer }, + { binding: 1, resource: buffer0 }, + { binding: 2, resource: buffer1 }, ], }); const bindGroup1 = device.createBindGroup({ layout: bindGroupLayoutCompute, entries: [ - { binding: 0, resource: { buffer: sizeBuffer } }, - { binding: 1, resource: { buffer: buffer1 } }, - { binding: 2, resource: { buffer: buffer0 } }, + { binding: 0, resource: sizeBuffer }, + { binding: 1, resource: buffer1 }, + { binding: 2, resource: buffer0 }, ], }); @@ -210,11 +210,7 @@ function resetGameData() { entries: [ { binding: 0, - resource: { - buffer: sizeBuffer, - offset: 0, - size: 2 * Uint32Array.BYTES_PER_ELEMENT, - }, + resource: sizeBuffer, }, ], }); diff --git a/sample/generateMipmap/main.ts b/sample/generateMipmap/main.ts index 5f2545ca..11179f4b 100644 --- a/sample/generateMipmap/main.ts +++ b/sample/generateMipmap/main.ts @@ -187,7 +187,7 @@ const objects = textures.map(({ texture, viewDimension }) => { const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 0, resource: uniformBuffer }, { binding: 1, resource: sampler }, { binding: 2, diff --git a/sample/imageBlur/main.ts b/sample/imageBlur/main.ts index 241b0d4a..bfc146da 100644 --- a/sample/imageBlur/main.ts +++ b/sample/imageBlur/main.ts @@ -126,90 +126,43 @@ const blurParamsBuffer = device.createBuffer({ const computeConstants = device.createBindGroup({ layout: blurPipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: sampler, - }, - { - binding: 1, - resource: { - buffer: blurParamsBuffer, - }, - }, + { binding: 0, resource: sampler }, + { binding: 1, resource: blurParamsBuffer }, ], }); const computeBindGroup0 = device.createBindGroup({ layout: blurPipeline.getBindGroupLayout(1), entries: [ - { - binding: 1, - resource: imageTexture.createView(), - }, - { - binding: 2, - resource: textures[0].createView(), - }, - { - binding: 3, - resource: { - buffer: buffer0, - }, - }, + { binding: 1, resource: imageTexture.createView() }, + { binding: 2, resource: textures[0].createView() }, + { binding: 3, resource: buffer0 }, ], }); const computeBindGroup1 = device.createBindGroup({ layout: blurPipeline.getBindGroupLayout(1), entries: [ - { - binding: 1, - resource: textures[0].createView(), - }, - { - binding: 2, - resource: textures[1].createView(), - }, - { - binding: 3, - resource: { - buffer: buffer1, - }, - }, + { binding: 1, resource: textures[0].createView() }, + { binding: 2, resource: textures[1].createView() }, + { binding: 3, resource: buffer1 }, ], }); const computeBindGroup2 = device.createBindGroup({ layout: blurPipeline.getBindGroupLayout(1), entries: [ - { - binding: 1, - resource: textures[1].createView(), - }, - { - binding: 2, - resource: textures[0].createView(), - }, - { - binding: 3, - resource: { - buffer: buffer0, - }, - }, + { binding: 1, resource: textures[1].createView() }, + { binding: 2, resource: textures[0].createView() }, + { binding: 3, resource: buffer0 }, ], }); const showResultBindGroup = device.createBindGroup({ layout: fullscreenQuadPipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: sampler, - }, - { - binding: 1, - resource: textures[1].createView(), - }, + { binding: 0, resource: sampler }, + { binding: 1, resource: textures[1].createView() }, ], }); diff --git a/sample/instancedCube/main.ts b/sample/instancedCube/main.ts index 812416a9..f2106ab5 100644 --- a/sample/instancedCube/main.ts +++ b/sample/instancedCube/main.ts @@ -116,14 +116,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const aspect = canvas.width / canvas.height; diff --git a/sample/multipleCanvases/main.ts b/sample/multipleCanvases/main.ts index 715ec21a..0862917f 100644 --- a/sample/multipleCanvases/main.ts +++ b/sample/multipleCanvases/main.ts @@ -247,7 +247,7 @@ for (let i = 0; i < numProducts; ++i) { // Make a bind group for this uniform const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [{ binding: 0, resource: { buffer: uniformBuffer } }], + entries: [{ binding: 0, resource: uniformBuffer }], }); canvasToInfoMap.set(canvas, { diff --git a/sample/occlusionQuery/main.ts b/sample/occlusionQuery/main.ts index 81a9b1d0..7e9d8fac 100644 --- a/sample/occlusionQuery/main.ts +++ b/sample/occlusionQuery/main.ts @@ -107,7 +107,7 @@ const objectInfos = cubePositions.map(({ position, id, color }) => { const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [{ binding: 0, resource: { buffer: uniformBuffer } }], + entries: [{ binding: 0, resource: uniformBuffer }], }); return { diff --git a/sample/particles/main.ts b/sample/particles/main.ts index 21b6c79e..43a54fc4 100644 --- a/sample/particles/main.ts +++ b/sample/particles/main.ts @@ -138,14 +138,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: renderPipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { @@ -266,17 +259,17 @@ device.queue.copyExternalImageToTexture( { // ubo binding: 0, - resource: { buffer: probabilityMapUBOBuffer }, + resource: probabilityMapUBOBuffer, }, { // buf_in binding: 1, - resource: { buffer: level & 1 ? buffer_a : buffer_b }, + resource: level & 1 ? buffer_a : buffer_b, }, { // buf_out binding: 2, - resource: { buffer: level & 1 ? buffer_b : buffer_a }, + resource: level & 1 ? buffer_b : buffer_a, }, { // tex_in / tex_out @@ -370,24 +363,9 @@ const computePipeline = device.createComputePipeline({ const computeBindGroup = device.createBindGroup({ layout: computePipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: simulationUBOBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: particlesBuffer, - offset: 0, - size: numParticles * particleInstanceByteSize, - }, - }, - { - binding: 2, - resource: texture.createView(), - }, + { binding: 0, resource: simulationUBOBuffer }, + { binding: 1, resource: particlesBuffer }, + { binding: 2, resource: texture.createView() }, ], }); diff --git a/sample/points/main.ts b/sample/points/main.ts index 24932591..60512528 100644 --- a/sample/points/main.ts +++ b/sample/points/main.ts @@ -192,7 +192,7 @@ device.queue.copyExternalImageToTexture( const bindGroup = device.createBindGroup({ layout: bindGroupLayout, entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 0, resource: uniformBuffer }, { binding: 1, resource: sampler }, { binding: 2, resource: texture.createView() }, ], diff --git a/sample/primitivePicking/main.ts b/sample/primitivePicking/main.ts index 35ff2a47..24b88a1d 100644 --- a/sample/primitivePicking/main.ts +++ b/sample/primitivePicking/main.ts @@ -263,18 +263,8 @@ const frameUniformBuffer = device.createBuffer({ const sceneUniformBindGroup = device.createBindGroup({ layout: forwardRenderingPipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: modelUniformBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: frameUniformBuffer, - }, - }, + { binding: 0, resource: modelUniformBuffer }, + { binding: 1, resource: frameUniformBuffer }, ], }); diff --git a/sample/renderBundles/main.ts b/sample/renderBundles/main.ts index 46e9596f..46c30494 100644 --- a/sample/renderBundles/main.ts +++ b/sample/renderBundles/main.ts @@ -216,20 +216,9 @@ function createSphereBindGroup( const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(1), entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: sampler, - }, - { - binding: 2, - resource: texture.createView(), - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: sampler }, + { binding: 2, resource: texture.createView() }, ], }); @@ -299,14 +288,7 @@ const modelViewProjectionMatrix = mat4.create(); const frameBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); function getTransformationMatrix() { diff --git a/sample/resizeObserverHDDPI/main.ts b/sample/resizeObserverHDDPI/main.ts index 6d0f447c..6df7a08f 100644 --- a/sample/resizeObserverHDDPI/main.ts +++ b/sample/resizeObserverHDDPI/main.ts @@ -50,12 +50,7 @@ const uniformBuffer = device.createBuffer({ const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { buffer: uniformBuffer }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const settings = { diff --git a/sample/reversedZ/main.ts b/sample/reversedZ/main.ts index e79fbc65..91b7df49 100644 --- a/sample/reversedZ/main.ts +++ b/sample/reversedZ/main.ts @@ -450,35 +450,15 @@ const uniformBindGroups = [ device.createBindGroup({ layout: uniformBindGroupLayout, entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: cameraMatrixBuffer, - }, - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: cameraMatrixBuffer }, ], }), device.createBindGroup({ layout: uniformBindGroupLayout, entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: cameraMatrixReversedDepthBuffer, - }, - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: cameraMatrixReversedDepthBuffer }, ], }), ]; diff --git a/sample/rotatingCube/main.ts b/sample/rotatingCube/main.ts index a13b3a4f..f33d212d 100644 --- a/sample/rotatingCube/main.ts +++ b/sample/rotatingCube/main.ts @@ -108,14 +108,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { diff --git a/sample/samplerParameters/main.ts b/sample/samplerParameters/main.ts index 0cf3553b..2d87a9b1 100644 --- a/sample/samplerParameters/main.ts +++ b/sample/samplerParameters/main.ts @@ -312,8 +312,8 @@ function frame() { const bindGroup = device.createBindGroup({ layout: texturedSquareBGL, entries: [ - { binding: 0, resource: { buffer: bufConfig } }, - { binding: 1, resource: { buffer: bufMatrices } }, + { binding: 0, resource: bufConfig }, + { binding: 1, resource: bufMatrices }, { binding: 2, resource: sampler }, { binding: 3, resource: checkerboardView }, ], diff --git a/sample/shadowMapping/main.ts b/sample/shadowMapping/main.ts index edff255b..18c14058 100644 --- a/sample/shadowMapping/main.ts +++ b/sample/shadowMapping/main.ts @@ -230,14 +230,7 @@ const sceneUniformBuffer = device.createBuffer({ const sceneBindGroupForShadow = device.createBindGroup({ layout: uniformBufferBindGroupLayout, - entries: [ - { - binding: 0, - resource: { - buffer: sceneUniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: sceneUniformBuffer }], }); const sceneBindGroupForRender = device.createBindGroup({ @@ -245,9 +238,7 @@ const sceneBindGroupForRender = device.createBindGroup({ entries: [ { binding: 0, - resource: { - buffer: sceneUniformBuffer, - }, + resource: sceneUniformBuffer, }, { binding: 1, @@ -264,14 +255,7 @@ const sceneBindGroupForRender = device.createBindGroup({ const modelBindGroup = device.createBindGroup({ layout: uniformBufferBindGroupLayout, - entries: [ - { - binding: 0, - resource: { - buffer: modelUniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: modelUniformBuffer }], }); const eyePosition = vec3.fromValues(0, 50, -100); diff --git a/sample/skinnedMesh/glbUtils.ts b/sample/skinnedMesh/glbUtils.ts index 88446465..d352a00e 100644 --- a/sample/skinnedMesh/glbUtils.ts +++ b/sample/skinnedMesh/glbUtils.ts @@ -578,14 +578,7 @@ export class GLTFNode { }); this.nodeTransformBindGroup = device.createBindGroup({ layout: bgLayout, - entries: [ - { - binding: 0, - resource: { - buffer: this.nodeTransformGPUBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: this.nodeTransformGPUBuffer }], }); this.skin = skin; } @@ -765,18 +758,8 @@ export class GLTFSkin { layout: GLTFSkin.skinBindGroupLayout, label: 'StaticGLTFSkin.bindGroup', entries: [ - { - binding: 0, - resource: { - buffer: this.jointMatricesUniformBuffer, - }, - }, - { - binding: 1, - resource: { - buffer: this.inverseBindMatricesUniformBuffer, - }, - }, + { binding: 0, resource: this.jointMatricesUniformBuffer }, + { binding: 1, resource: this.inverseBindMatricesUniformBuffer }, ], }); } diff --git a/sample/stencilMask/main.ts b/sample/stencilMask/main.ts index 434e2e10..1b6d9009 100644 --- a/sample/stencilMask/main.ts +++ b/sample/stencilMask/main.ts @@ -265,8 +265,8 @@ function makeScene( const bindGroup = device.createBindGroup({ layout: bindGroupLayout, entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, - { binding: 1, resource: { buffer: sharedUniformBuffer } }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: sharedUniformBuffer }, ], }); diff --git a/sample/textRenderingMsdf/main.ts b/sample/textRenderingMsdf/main.ts index 2f2691b5..f169f42e 100644 --- a/sample/textRenderingMsdf/main.ts +++ b/sample/textRenderingMsdf/main.ts @@ -230,14 +230,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { diff --git a/sample/textRenderingMsdf/msdfText.ts b/sample/textRenderingMsdf/msdfText.ts index adcd3ebd..b38c7a07 100644 --- a/sample/textRenderingMsdf/msdfText.ts +++ b/sample/textRenderingMsdf/msdfText.ts @@ -321,7 +321,7 @@ export class MsdfTextRenderer { }, { binding: 2, - resource: { buffer: charsBuffer }, + resource: charsBuffer, }, ], }); @@ -400,14 +400,8 @@ export class MsdfTextRenderer { label: 'msdf text bind group', layout: this.textBindGroupLayout, entries: [ - { - binding: 0, - resource: { buffer: this.cameraUniformBuffer }, - }, - { - binding: 1, - resource: { buffer: textBuffer }, - }, + { binding: 0, resource: this.cameraUniformBuffer }, + { binding: 1, resource: textBuffer }, ], }); diff --git a/sample/texturedCube/main.ts b/sample/texturedCube/main.ts index f24d8e17..29757429 100644 --- a/sample/texturedCube/main.ts +++ b/sample/texturedCube/main.ts @@ -136,20 +136,9 @@ const sampler = device.createSampler({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - { - binding: 1, - resource: sampler, - }, - { - binding: 2, - resource: cubeTexture.createView(), - }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: sampler }, + { binding: 2, resource: cubeTexture.createView() }, ], }); diff --git a/sample/timestampQuery/main.ts b/sample/timestampQuery/main.ts index c1424a78..4d5686c2 100644 --- a/sample/timestampQuery/main.ts +++ b/sample/timestampQuery/main.ts @@ -141,14 +141,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { diff --git a/sample/transparentCanvas/main.ts b/sample/transparentCanvas/main.ts index f26d76c3..6f365148 100644 --- a/sample/transparentCanvas/main.ts +++ b/sample/transparentCanvas/main.ts @@ -104,14 +104,7 @@ const uniformBuffer = device.createBuffer({ const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { diff --git a/sample/videoUploading/main.ts b/sample/videoUploading/main.ts index b017690c..a66c1e6b 100644 --- a/sample/videoUploading/main.ts +++ b/sample/videoUploading/main.ts @@ -130,20 +130,14 @@ function drawVideo() { const bindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), entries: [ - { - binding: 1, - resource: sampler, - }, + { binding: 1, resource: sampler }, { binding: 2, resource: device.importExternalTexture({ source: externalTextureSource, }), }, - { - binding: 3, - resource: { buffer: uniformBuffer }, - }, + { binding: 3, resource: uniformBuffer }, ], }); diff --git a/sample/volumeRenderingTexture3D/main.ts b/sample/volumeRenderingTexture3D/main.ts index ce8ee0d0..b85d555e 100644 --- a/sample/volumeRenderingTexture3D/main.ts +++ b/sample/volumeRenderingTexture3D/main.ts @@ -189,9 +189,7 @@ const bindGroupDescriptor: GPUBindGroupDescriptor = { entries: [ { binding: 0, - resource: { - buffer: uniformBuffer, - }, + resource: uniformBuffer, }, { binding: 1, diff --git a/sample/wireframe/main.ts b/sample/wireframe/main.ts index f30ba642..a82b427c 100644 --- a/sample/wireframe/main.ts +++ b/sample/wireframe/main.ts @@ -261,7 +261,7 @@ for (let i = 0; i < numObjects; ++i) { // Make a bind group for this uniform const litBindGroup = device.createBindGroup({ layout: litBindGroupLayout, - entries: [{ binding: 0, resource: { buffer: uniformBuffer } }], + entries: [{ binding: 0, resource: uniformBuffer }], }); // Note: We're making one lineUniformBuffer per object. @@ -283,20 +283,20 @@ for (let i = 0; i < numObjects; ++i) { const wireframeBindGroup = device.createBindGroup({ layout: wireframePipeline.getBindGroupLayout(0), entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, - { binding: 1, resource: { buffer: model.vertexBuffer } }, - { binding: 2, resource: { buffer: model.indexBuffer } }, - { binding: 3, resource: { buffer: lineUniformBuffer } }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: model.vertexBuffer }, + { binding: 2, resource: model.indexBuffer }, + { binding: 3, resource: lineUniformBuffer }, ], }); const barycentricCoordinatesBasedWireframeBindGroup = device.createBindGroup({ layout: barycentricCoordinatesBasedWireframePipeline.getBindGroupLayout(0), entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, - { binding: 1, resource: { buffer: model.vertexBuffer } }, - { binding: 2, resource: { buffer: model.indexBuffer } }, - { binding: 3, resource: { buffer: lineUniformBuffer } }, + { binding: 0, resource: uniformBuffer }, + { binding: 1, resource: model.vertexBuffer }, + { binding: 2, resource: model.indexBuffer }, + { binding: 3, resource: lineUniformBuffer }, ], }); diff --git a/sample/worker/worker.ts b/sample/worker/worker.ts index a543022c..69151da5 100644 --- a/sample/worker/worker.ts +++ b/sample/worker/worker.ts @@ -126,14 +126,7 @@ async function init(canvas) { const uniformBindGroup = device.createBindGroup({ layout: pipeline.getBindGroupLayout(0), - entries: [ - { - binding: 0, - resource: { - buffer: uniformBuffer, - }, - }, - ], + entries: [{ binding: 0, resource: uniformBuffer }], }); const renderPassDescriptor: GPURenderPassDescriptor = { diff --git a/sample/workloadSimulator/index.html b/sample/workloadSimulator/index.html index 7605fdf3..b2378ea8 100644 --- a/sample/workloadSimulator/index.html +++ b/sample/workloadSimulator/index.html @@ -710,7 +710,7 @@