Skip to content

wgpu does not honor platform alignment requirements on texture-buffer copies when they are stricter than WebGPU #7946

@andyleiserson

Description

@andyleiserson

As @cwfitzgerald noted in #6827, Metal specifies a "Buffer alignment for copying an existing texture to a
buffer" of 16B. WebGPU does not have this restriction. WebGPU's validating texture buffer copy only requires that the offset is aligned to a multiple of the block copy size, or in the case of depth/stencil, to 4B.

There are also failures of the offset_and_bytesPerRow and depth_stencil_format,copy_buffer_offset tests on dx12 that I haven't investigated, but I suspect may be a similar issue. Some of these may be fixed by #7721.

I noticed this while working on #7936, but I don't know if the CTS test in that issue (api,validation,image_copy,buffer_texture_copies:offset_and_bytesPerRow) will reliably catch issues here, since it's only checking the WebGPU requirements. It will only find violations of platform requirements if the violation actually occurs, if it results in a functional difference under the conditions of the test, and if the test is checking for functional correctness and not just correct validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions