diff --git a/sample/a-buffer/main.ts b/sample/a-buffer/main.ts index eba8513f..419712d2 100644 --- a/sample/a-buffer/main.ts +++ b/sample/a-buffer/main.ts @@ -448,21 +448,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, @@ -484,21 +478,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 59b41388..786cf626 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 dcd2fdef..ac862f11 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 f74b2a84..c136dffa 100644 --- a/sample/computeBoids/main.ts +++ b/sample/computeBoids/main.ts @@ -228,28 +228,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 06dc6613..c221e968 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 86956dd0..c9d3ee3e 100644 --- a/sample/deferredRendering/main.ts +++ b/sample/deferredRendering/main.ts @@ -334,36 +334,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] }, ], }); @@ -431,21 +412,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, }, ], }); @@ -454,21 +429,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 c6f98e73..80340a01 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 363485e4..dcfe3ed2 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 a2c02b3c..0152c480 100644 --- a/sample/generateMipmap/main.ts +++ b/sample/generateMipmap/main.ts @@ -189,7 +189,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 0406c7e2..46f82118 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 ab51cf89..fec0d7ce 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 8e2ccec9..186ad4f4 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 5df06ec4..425b7b4d 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 89a89bfd..920155f7 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 fc48775b..201d625f 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/renderBundles/main.ts b/sample/renderBundles/main.ts index 1232d994..6e6c15fd 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 65eef702..f6317b0e 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 14ec31ef..f47f3cd7 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 ccdf5685..a244c6fd 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 984dc92e..33bbbcae 100644 --- a/sample/samplerParameters/main.ts +++ b/sample/samplerParameters/main.ts @@ -309,8 +309,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 dc5069db..f967b509 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 725dcfd9..5bfd977b 100644 --- a/sample/stencilMask/main.ts +++ b/sample/stencilMask/main.ts @@ -257,8 +257,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 7041c92e..3e6cc14f 100644 --- a/sample/textRenderingMsdf/main.ts +++ b/sample/textRenderingMsdf/main.ts @@ -227,14 +227,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 cefbf80b..d8dfc717 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 b35d853c..148b9bc1 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 d67d0f80..aabfab7c 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/volumeRenderingTexture3D/main.ts b/sample/volumeRenderingTexture3D/main.ts index a6e75d78..f1ca9335 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 014f90eb..711e7b9e 100644 --- a/sample/wireframe/main.ts +++ b/sample/wireframe/main.ts @@ -258,7 +258,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. @@ -280,20 +280,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/workloadSimulator/index.html b/sample/workloadSimulator/index.html index ce8933bc..fb9f3ee9 100644 --- a/sample/workloadSimulator/index.html +++ b/sample/workloadSimulator/index.html @@ -700,7 +700,7 @@

Web graphics workload simulator

bindGroup = device.createBindGroup({ layout: bindGroupLayout, entries: [ - { binding: 0, resource: { buffer: uniformBuffer } }, + { binding: 0, resource: uniformBuffer }, { binding: 1, resource: sampler }, { binding: 2, resource: texture.createView() }, ],