Documentation
    Preparing search index...

    Interface GpuCommandEncoder

    Records passes into a command buffer.

    interface GpuCommandEncoder {
        beginComputePass?(
            descriptor?: { label?: string },
        ): GpuComputePassEncoder;
        beginRenderPass(descriptor: GpuRenderPassDescriptor): GpuRenderPassEncoder;
        copyBufferToBuffer?(
            source: GpuBuffer,
            sourceOffset: number,
            destination: GpuBuffer,
            destinationOffset: number,
            size: number,
        ): void;
        copyTextureToBuffer?(
            source: {
                mipLevel?: number;
                origin?: readonly [number, number];
                texture: GpuTexture;
            },
            destination: {
                buffer: GpuBuffer;
                bytesPerRow: number;
                rowsPerImage?: number;
            },
            size: readonly [number, number],
        ): void;
        finish(): object;
        resolveQuerySet?(
            querySet: GpuQuerySet,
            firstQuery: number,
            queryCount: number,
            destination: GpuBuffer,
            destinationOffset: number,
        ): void;
    }
    Index
    • Copies a buffer range into another buffer — compute readback's mechanism (wgpu-compute.ts), the buffer-to-buffer half of WP-R1.6's copyTextureToBuffer, optional on the same presence-is-the-capability terms.

      Parameters

      • source: GpuBuffer
      • sourceOffset: number
      • destination: GpuBuffer
      • destinationOffset: number
      • size: number

      Returns void

    • Copies a texture's texels into a buffer — readPixels' mechanism (WP-R1.6, RFC 0005). Optional for GpuBuffer.mapAsync's reason: presence is the capability, and only the readback path calls it. bytesPerRow must be a multiple of 256 (the WebGPU constant COPY_BYTES_PER_ROW_ALIGNMENT); wgpu-readback.ts owns that arithmetic.

      Parameters

      • source: { mipLevel?: number; origin?: readonly [number, number]; texture: GpuTexture }
        • Optional ReadonlymipLevel?: number
        • Optional Readonlyorigin?: readonly [number, number]

          Top-left corner of the copied rectangle in the texture's own top-first coordinates, [x, y] — §61's region form (2026-08-29). Omitted for a whole-texture copy, and only then, so the whole-target tape WP-R1.6 recorded stays byte-identical. wgpu-readback.ts owns the §7a bottom-origin conversion.

        • Readonlytexture: GpuTexture
      • destination: { buffer: GpuBuffer; bytesPerRow: number; rowsPerImage?: number }
      • size: readonly [number, number]

      Returns void

    • Copies query results into destination (A-1). Optional — presence is the capability, and only the GPU-frame timer calls it.

      Parameters

      • querySet: GpuQuerySet
      • firstQuery: number
      • queryCount: number
      • destination: GpuBuffer
      • destinationOffset: number

      Returns void