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

empty array entries in createPipelineLayout and other place should/should not be ignored? #4879

@greggman

Description

@greggman

Posting this here instead of filing a bug. Maybe it's the specified behavior but ....

If I call device.createPipelineLayout with empty elements it ignores them.

In other words

device.createPipelineLayout({ bindGroupLayouts: [ validBGL ] });            // should pass. passes
device.createPipelineLayout({ bindGroupLayouts: [ undefined, validBGL ] }); // should fail. fails
device.createPipelineLayout({ bindGroupLayouts: [ ,,validBGL ] });          // should fail? does not fail
device.createPipelineLayout({ bindGroupLayouts: [ validBGL,, ] });          // should fail? does not fail
device.createPipelineLayout({ bindGroupLayouts: [ validBGL,,valiaBGL ] });  // should fail? does not fail

empty entries are not ignored other places. For example new Float32Array([,,7]) makes [NaN, NaN, 7]

For createPipelineLayout the spec says

Let allEntries be the result of concatenating bgl.[[descriptor]].entries for all bgl in descriptor.bindGroupLayouts.

Which does kind of suggest these empty elements are ok? But checking other places, an empty element isn't okay. For example createBindGroup({ entries: [, validEntry ] }) fails. createRenderPipeline({ ... vertex: { buffers: [ { attrib: [,,, someValidAttribute ] } ] } } ) fails. Those specs make it sound they could succeed based on similar wording. For example:

For each attribute attrib in the list descriptor.attributes:

Well, an array of atttributes: [,,,validAttribute,,,validAttrubte] has 2 attributes but fails

Should this be clarified? And are CTS tests needed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU APIbugneeds-cts-issueThis change requires tests (or would need tests if accepted), but may not have a CTS issue filed yet

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions