@@ -14,15 +14,7 @@ | GPUColorDict; type GPUColorWriteFlags = number; -type GPUDepthBias = - number; -type GPUExtent3D = - - | Array - | GPUExtent3DDict; -type GPUFlagsConstant = - number; -type GPUImageCopyExternalImageSource = +type GPUCopyExternalImageSource = | ImageBitmap | ImageData @@ -809,106 +866,6 @@ targets: Array; } -interface GPUImageCopyBuffer - extends GPUImageDataLayout { - /** - * A buffer which either contains image data to be copied or will store the image data being - * copied, depending on the method it is being passed to. - */ - buffer: GPUBuffer; -} - -interface GPUImageCopyExternalImage { - /** - * The source of the image copy. The copy source data is captured at the moment that - * {@link GPUQueue#copyExternalImageToTexture} is issued. Source size is determined as described - * by the external source dimensions table. - */ - source: GPUImageCopyExternalImageSource; - /** - * Defines the origin of the copy - the minimum (top-left) corner of the source sub-region to copy from. - * Together with `copySize`, defines the full copy sub-region. - */ - origin?: GPUOrigin2D; - /** - * Describes whether the source image is vertically flipped, or not. - * If this option is set to `true`, the copy is flipped vertically: the bottom row of the source - * region is copied into the first row of the destination region, and so on. - * The {@link GPUImageCopyExternalImage#origin} option is still relative to the top-left corner - * of the source image, increasing downward. - */ - flipY?: boolean; -} - -interface GPUImageCopyTexture { - /** - * Texture to copy to/from. - */ - texture: GPUTexture; - /** - * Mip-map level of the {@link GPUImageCopyTexture#texture} to copy to/from. - */ - mipLevel?: GPUIntegerCoordinate; - /** - * Defines the origin of the copy - the minimum corner of the texture sub-region to copy to/from. - * Together with `copySize`, defines the full copy sub-region. - */ - origin?: GPUOrigin3D; - /** - * Defines which aspects of the {@link GPUImageCopyTexture#texture} to copy to/from. - */ - aspect?: GPUTextureAspect; -} - -interface GPUImageCopyTextureTagged - extends GPUImageCopyTexture { - /** - * Describes the color space and encoding used to encode data into the destination texture. - * This [[#color-space-conversions|may result]] in values outside of the range [0, 1] - * being written to the target texture, if its format can represent them. - * Otherwise, the results are clamped to the target texture format's range. - * Note: - * If {@link GPUImageCopyTextureTagged#colorSpace} matches the source image, - * conversion may not be necessary. See [[#color-space-conversion-elision]]. - */ - colorSpace?: PredefinedColorSpace; - /** - * Describes whether the data written into the texture should have its RGB channels - * premultiplied by the alpha channel, or not. - * If this option is set to `true` and the {@link GPUImageCopyExternalImage#source} is also - * premultiplied, the source RGB values must be preserved even if they exceed their - * corresponding alpha values. - * Note: - * If {@link GPUImageCopyTextureTagged#premultipliedAlpha} matches the source image, - * conversion may not be necessary. See [[#color-space-conversion-elision]]. - */ - premultipliedAlpha?: boolean; -} - -interface GPUImageDataLayout { - /** - * The offset, in bytes, from the beginning of the image data source (such as a - * {@link GPUImageCopyBuffer#buffer|GPUImageCopyBuffer.buffer}) to the start of the image data - * within that source. - */ - offset?: GPUSize64; - /** - * The stride, in bytes, between the beginning of each texel block row and the subsequent - * texel block row. - * Required if there are multiple texel block rows (i.e. the copy height or depth is more - * than one block). - */ - bytesPerRow?: GPUSize32; - /** - * Number of texel block rows per single texel image of the texture. - * {@link GPUImageDataLayout#rowsPerImage} × - * {@link GPUImageDataLayout#bytesPerRow} is the stride, in bytes, between the beginning of each - * texel image of data and the subsequent texel image. - * Required if there are multiple texel images (i.e. the copy depth is more than one). - */ - rowsPerImage?: GPUSize32; -} - interface GPUMultisampleState { /** * Number of samples per pixel. This {@link GPURenderPipeline} will be compatible only @@ -966,11 +923,11 @@ interface GPUPipelineLayoutDescriptor extends GPUObjectDescriptorBase { /** - * A list of {@link GPUBindGroupLayout}s the pipeline will use. Each element corresponds to a - * @group attribute in the {@link GPUShaderModule}, with the `N`th element corresponding with - * `@group(N)`. + * A list of optional {@link GPUBindGroupLayout}s the pipeline will use. Each element corresponds + * to a @group attribute in the {@link GPUShaderModule}, with the `N`th element corresponding + * with `@group(N)`. */ - bindGroupLayouts: Array; + bindGroupLayouts: Array; } interface GPUPrimitiveState { @@ -2047,8 +2057,8 @@ * `copySize`: */ copyBufferToTexture( - source: GPUImageCopyBuffer, - destination: GPUImageCopyTexture, + source: GPUTexelCopyBufferInfo, + destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D ): undefined; /** @@ -2059,8 +2069,8 @@ * `copySize`: */ copyTextureToBuffer( - source: GPUImageCopyTexture, - destination: GPUImageCopyBuffer, + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3D ): undefined; /** @@ -2072,8 +2082,8 @@ * `copySize`: */ copyTextureToTexture( - source: GPUImageCopyTexture, - destination: GPUImageCopyTexture, + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D ): undefined; /** @@ -2545,16 +2555,16 @@ * @param size - Extents of the content to write from `data` to `destination`. */ writeTexture( - destination: GPUImageCopyTexture, + destination: GPUTexelCopyTextureInfo, data: AllowSharedBufferSource, - dataLayout: GPUImageDataLayout, + dataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D ): undefined; /** * Issues a copy operation of the contents of a platform image/canvas * into the destination texture. * This operation performs [[#color-space-conversions|color encoding]] into the destination - * encoding according to the parameters of {@link GPUImageCopyTextureTagged}. + * encoding according to the parameters of {@link GPUCopyExternalImageDestInfo}. * Copying into a `-srgb` texture results in the same texture bytes, not the same decoded * values, as copying into the corresponding non-`-srgb` format. * Thus, after a copy operation, sampling the destination texture has @@ -2565,8 +2575,8 @@ * @param copySize - Extents of the content to write from `source` to `destination`. */ copyExternalImageToTexture( - source: GPUImageCopyExternalImage, - destination: GPUImageCopyTextureTagged, + source: GPUCopyExternalImageSourceInfo, + destination: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D ): undefined; }