这是indexloc提供的服务,不要输入任何密码
Skip to content

Make GPUBufferBinding size optional  #331

@beaufortfrancois

Description

@beaufortfrancois

How about making GPUBufferBinding size optional? If not specified, it would be the same as the buffer size passed in the binding resource of device.createBindGroup()?

I believe this would make code easier to read and digest for newcomers.

    const gpuBufferSize = 4;
    const gpuBuffer = device.createBuffer({
      size: gpuBufferSize,
      usage: GPUBufferUsage.STORAGE
    });

    const bindGroup = device.createBindGroup({
      layout: bindGroupLayout,
      bindings: [
        {
          binding: 0,
          resource: {
            buffer: myGpuBuffer,
-           size: gpuBufferSize
          }
        }
      ]
    });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions