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

GPUBindGroupLayoutEntry is accepting an empty dictionary for externalTexture, should accept boolean instead #5249

@saschanaz

Description

@saschanaz
dictionary GPUBindGroupLayoutEntry {
    required GPUIndex32 binding;
    required GPUShaderStageFlags visibility;

    GPUBufferBindingLayout buffer;
    GPUSamplerBindingLayout sampler;
    GPUTextureBindingLayout texture;
    GPUStorageTextureBindingLayout storageTexture;
    GPUExternalTextureBindingLayout externalTexture;
};
dictionary GPUExternalTextureBindingLayout {
};

This is surprising. It should accept boolean instead and add the dictionary when it's actually needed.

Changing it to boolean won't cause webcompat issue as {} will be automatically coerced to true. Changing it from boolean back to dictionary won't cause webcompat issue either, if we do this:

(boolean or GPUExternalTextureBindingLayout) externalTexture;

which is abundant in web platform: https://github.com/search?q=repo%3Aw3c%2Fwebref%20%22(boolean%20or%22&type=code

Dictionary fields with no required member should also accept booleans for consistency.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiWebGPU API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions