Skip to content

Change for "Allow GPUTexture where GPUTextureView is used"? #597

Description

@kainino0x

Issue corresponding to upstream spec change gpuweb/gpuweb#5228
Which is just an ergonomic improvement.

We did not make any change to webgpu.h for this change. I'm just filing this issue to document why Dawn didn't propose any change.

The C struct is:

typedef struct WGPUBindGroupEntry {
    WGPUChainedStruct * nextInChain;
    uint32_t binding;
    WGPU_NULLABLE WGPUBuffer buffer;
    uint64_t offset;
    uint64_t size;
    WGPU_NULLABLE WGPUSampler sampler;
    WGPU_NULLABLE WGPUTextureView textureView;
} WGPUBindGroupEntry WGPU_STRUCTURE_ATTRIBUTE;

We can't edit this because it's stable. So we would need to add an extension struct like:

// chained in WGPUBindGroupEntry
typedef struct WGPUTextureBindingEntry {
    WGPUChainedStruct chain;
    WGPUTexture texture;
} WGPUTextureBindingEntry WGPU_STRUCTURE_ATTRIBUTE;

However this is unergonomic and defeats the purpose of the ergonomic improvement. It's much easier to just type .CreateView().

So there is no point in adding anything to webgpu.h.

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