writeTexture method

void writeTexture(
  1. GPUTexelCopyTextureInfo destination,
  2. JSObject data,
  3. GPUTexelCopyBufferLayout dataLayout,
  4. GPUExtent3DDict size,
)

Pixels into a texture, at a mip level and an array layer named by destination.

This is how a cube face and a mip level get their contents. There is no six-argument upload call and no face enumeration in WebGPU: a cube is a six-layer 2D array, a face is origin.z, and a level is mipLevel. The contract's createCubeTextureFromPixels becomes six of these per level.

Implementation

external void writeTexture(
  GPUTexelCopyTextureInfo destination,
  JSObject data,
  GPUTexelCopyBufferLayout dataLayout,
  GPUExtent3DDict size,
);