gpuweb/types

Confused by the types of copyBufferToTexture

baptistemanson opened this issue · 1 comments

I read the great proposal for copy by @Kangz . I understood we want to support "copy a portion of the buffer to a region of the texture".

In the specs the last parameter of the copyBufferToTexture is:
typedef (sequence<GPUIntegerCoordinate> or GPUExtent3DDict) GPUExtent3D;

In the types I see:

// (either a point xor dimension).
export type GPUExtent3D = [number, number, number] | GPUExtent3DDict;

A XOR/union sounds inadequate, I think we wanted at least an intersection (both offset and dimensions to define a proper region)?
Or are we expected to change the offset in the buffer object and the texture object directly?

Thank you!

[number, number, number] and { width, height, depth } are just two ways you can pass the extent into WebGPU. Spec here.

The offset is in GPUTextureCopyView.origin.