From 9856759e7f8a819b50757e67669f10971500a9c2 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Mon, 4 Nov 2024 10:19:03 -0800 Subject: [PATCH] Rename copy types following the deprecation in webgpu/types --- .../command_buffer/image_copy.spec.ts | 22 +++++++------- .../cmds/copyTextureToTexture.spec.ts | 6 ++-- .../image_copy/buffer_texture_copies.spec.ts | 12 ++++---- .../api/validation/image_copy/image_copy.ts | 6 ++-- .../CopyExternalImageToTexture.spec.ts | 4 +-- src/webgpu/gpu_test.ts | 14 ++++----- src/webgpu/util/copy_to_texture.ts | 4 +-- src/webgpu/util/texture.ts | 4 +-- src/webgpu/util/texture/layout.ts | 2 +- src/webgpu/util/texture/texture_ok.ts | 4 +-- .../copyToTexture/ImageBitmap.spec.ts | 24 +++++++-------- .../copyToTexture/ImageData.spec.ts | 12 ++++---- .../web_platform/copyToTexture/canvas.spec.ts | 30 +++++++++---------- .../web_platform/copyToTexture/image.spec.ts | 12 ++++---- .../web_platform/copyToTexture/video.spec.ts | 4 +-- 15 files changed, 80 insertions(+), 80 deletions(-) diff --git a/src/webgpu/api/operation/command_buffer/image_copy.spec.ts b/src/webgpu/api/operation/command_buffer/image_copy.spec.ts index b27ecbbb91d0..73f1ff751b4c 100644 --- a/src/webgpu/api/operation/command_buffer/image_copy.spec.ts +++ b/src/webgpu/api/operation/command_buffer/image_copy.spec.ts @@ -126,7 +126,7 @@ const altDataGenerator = new DataArrayGenerator(); class ImageCopyTest extends TextureTestMixin(GPUTest) { /** - * This is used for testing passing undefined members of `GPUImageDataLayout` instead of actual + * This is used for testing passing undefined members of `GPUTexelCopyBufferLayout` instead of actual * values where possible. Passing arguments as values and not as objects so that they are passed * by copy and not by reference. */ @@ -135,7 +135,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { rowsPerImage: number | undefined, bytesPerRow: number | undefined, changeBeforePass: ChangeBeforePass - ): GPUImageDataLayout { + ): GPUTexelCopyBufferLayout { if (changeBeforePass === 'undefined') { if (offset === 0) { offset = undefined; @@ -151,7 +151,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { } /** - * This is used for testing passing undefined members of `GPUImageCopyTexture` instead of actual + * This is used for testing passing undefined members of `GPUTexelCopyTextureInfo` instead of actual * values where possible and also for testing passing the origin as `[number, number, number]`. * Passing arguments as values and not as objects so that they are passed by copy and not by * reference. @@ -163,7 +163,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { origin_z: number | undefined, mipLevel: number | undefined, changeBeforePass: ChangeBeforePass - ): GPUImageCopyTexture { + ): GPUTexelCopyTextureInfo { let origin: GPUOrigin3D | undefined = { x: origin_x, y: origin_y, z: origin_z }; if (changeBeforePass === 'undefined') { @@ -225,7 +225,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { buffer: GPUBuffer, format: ColorTextureFormat, size: Required, - dataLayout: Required + dataLayout: Required ) { if (isCompressedTextureFormat(format)) { this.expectGPUBufferValuesEqual(buffer, expected); @@ -323,7 +323,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { /** Run a CopyT2B command with appropriate arguments corresponding to `ChangeBeforePass` */ copyTextureToBufferWithAppliedArguments( buffer: GPUBuffer, - { offset, rowsPerImage, bytesPerRow }: Required, + { offset, rowsPerImage, bytesPerRow }: Required, { width, height, depthOrArrayLayers }: Required, { texture, mipLevel, origin }: TextureCopyViewWithRequiredOrigin, changeBeforePass: ChangeBeforePass @@ -363,7 +363,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { /** Put data into a part of the texture with an appropriate method. */ uploadLinearTextureDataToTextureSubBox( textureCopyView: TextureCopyViewWithRequiredOrigin, - textureDataLayout: GPUImageDataLayout & { bytesPerRow: number }, + textureDataLayout: GPUTexelCopyBufferLayout & { bytesPerRow: number }, copySize: Required, partialData: Uint8Array, method: InitMethod, @@ -432,7 +432,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { copySize: Required, format: ColorTextureFormat, expected: Uint8Array, - expectedDataLayout: Required + expectedDataLayout: Required ): void { const size = [ actualTexture.width, @@ -507,7 +507,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { checkSize: Required, format: ColorTextureFormat, expected: Uint8Array, - expectedDataLayout: Required, + expectedDataLayout: Required, changeBeforePass: ChangeBeforePass = 'none' ): void { // The alignment is necessary because we need to copy and map data from this buffer. @@ -573,7 +573,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { copyWholeTextureToBufferAndCheckContentsWithUpdatedData( { texture, mipLevel, origin }: TextureCopyViewWithRequiredOrigin, fullTextureCopyLayout: TextureCopyLayout, - texturePartialDataLayout: Required, + texturePartialDataLayout: Required, copySize: Required, format: ColorTextureFormat, fullData: GPUBuffer, @@ -632,7 +632,7 @@ class ImageCopyTest extends TextureTestMixin(GPUTest) { checkMethod, changeBeforePass = 'none', }: { - textureDataLayout: Required; + textureDataLayout: Required; copySize: Required; dataSize: number; mipLevel?: number; diff --git a/src/webgpu/api/validation/encoding/cmds/copyTextureToTexture.spec.ts b/src/webgpu/api/validation/encoding/cmds/copyTextureToTexture.spec.ts index c49261c0a055..f29ca3d9057c 100644 --- a/src/webgpu/api/validation/encoding/cmds/copyTextureToTexture.spec.ts +++ b/src/webgpu/api/validation/encoding/cmds/copyTextureToTexture.spec.ts @@ -19,8 +19,8 @@ import { ValidationTest } from '../../validation_test.js'; class F extends ValidationTest { TestCopyTextureToTexture( - source: GPUImageCopyTexture, - destination: GPUImageCopyTexture, + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3D, expectation: 'Success' | 'FinishError' | 'SubmitError' ): void { @@ -691,7 +691,7 @@ TODO: Extend to 1D and 3D textures.` g.test('copy_aspects') .desc( ` -Test the validations on the member 'aspect' of GPUImageCopyTexture in CopyTextureToTexture(). +Test the validations on the member 'aspect' of GPUTexelCopyTextureInfo in CopyTextureToTexture(). - for all the color and depth-stencil formats: the texture copy aspects must be both 'all'. - for all the depth-only formats: the texture copy aspects must be either 'all' or 'depth-only'. - for all the stencil-only formats: the texture copy aspects must be either 'all' or 'stencil-only'. diff --git a/src/webgpu/api/validation/image_copy/buffer_texture_copies.spec.ts b/src/webgpu/api/validation/image_copy/buffer_texture_copies.spec.ts index 937861cea03e..d417f23137fa 100644 --- a/src/webgpu/api/validation/image_copy/buffer_texture_copies.spec.ts +++ b/src/webgpu/api/validation/image_copy/buffer_texture_copies.spec.ts @@ -18,8 +18,8 @@ import { ValidationTest } from '../validation_test.js'; class ImageCopyTest extends ValidationTest { testCopyBufferToTexture( - source: GPUImageCopyBuffer, - destination: GPUImageCopyTexture, + source: GPUTexelCopyBufferInfo, + destination: GPUTexelCopyTextureInfo, copySize: GPUExtent3DStrict, isSuccess: boolean ): void { @@ -29,8 +29,8 @@ class ImageCopyTest extends ValidationTest { } testCopyTextureToBuffer( - source: GPUImageCopyTexture, - destination: GPUImageCopyBuffer, + source: GPUTexelCopyTextureInfo, + destination: GPUTexelCopyBufferInfo, copySize: GPUExtent3DStrict, isSuccess: boolean ): void { @@ -40,9 +40,9 @@ class ImageCopyTest extends ValidationTest { } testWriteTexture( - destination: GPUImageCopyTexture, + destination: GPUTexelCopyTextureInfo, uploadData: Uint8Array, - dataLayout: GPUImageDataLayout, + dataLayout: GPUTexelCopyBufferLayout, copySize: GPUExtent3DStrict, isSuccess: boolean ): void { diff --git a/src/webgpu/api/validation/image_copy/image_copy.ts b/src/webgpu/api/validation/image_copy/image_copy.ts index 1a86fac68794..42c40c42c536 100644 --- a/src/webgpu/api/validation/image_copy/image_copy.ts +++ b/src/webgpu/api/validation/image_copy/image_copy.ts @@ -11,8 +11,8 @@ import { ValidationTest } from '../validation_test.js'; export class ImageCopyTest extends ValidationTest { testRun( - textureCopyView: GPUImageCopyTexture, - textureDataLayout: GPUImageDataLayout, + textureCopyView: GPUTexelCopyTextureInfo, + textureDataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D, { method, @@ -122,7 +122,7 @@ export class ImageCopyTest extends ValidationTest { testBuffer( buffer: GPUBuffer, texture: GPUTexture, - textureDataLayout: GPUImageDataLayout, + textureDataLayout: GPUTexelCopyBufferLayout, size: GPUExtent3D, { method, diff --git a/src/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture.spec.ts b/src/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture.spec.ts index 5677a81cc03c..622133721bed 100644 --- a/src/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture.spec.ts +++ b/src/webgpu/api/validation/queue/copyToTexture/CopyExternalImageToTexture.spec.ts @@ -178,8 +178,8 @@ class CopyExternalImageToTextureTest extends ValidationTest { } runTest( - imageBitmapCopyView: GPUImageCopyExternalImage, - textureCopyView: GPUImageCopyTextureTagged, + imageBitmapCopyView: GPUCopyExternalImageSourceInfo, + textureCopyView: GPUCopyExternalImageDestInfo, copySize: GPUExtent3D, validationScopeSuccess: boolean, exceptionName?: string diff --git a/src/webgpu/gpu_test.ts b/src/webgpu/gpu_test.ts index ef210712feed..b9ee2b776db5 100644 --- a/src/webgpu/gpu_test.ts +++ b/src/webgpu/gpu_test.ts @@ -1296,7 +1296,7 @@ export interface TextureTestMixinType { * to the expected TexelView passes without error. */ expectTexelViewComparisonIsOkInTexture( - src: GPUImageCopyTexture, + src: GPUTexelCopyTextureInfo, exp: TexelView, size: GPUExtent3D, comparisonOptions?: TexelCompareOptions @@ -1307,7 +1307,7 @@ export interface TextureTestMixinType { * their expected colors without error. */ expectSinglePixelComparisonsAreOkInTexture( - src: GPUImageCopyTexture, + src: GPUTexelCopyTextureInfo, exp: PerPixelComparison[], comparisonOptions?: TexelCompareOptions ): void; @@ -1383,7 +1383,7 @@ export interface TextureTestMixinType { * Gets a byte offset to a texel */ getTexelOffsetInBytes( - textureDataLayout: Required, + textureDataLayout: Required, format: ColorTextureFormat, texel: Required, origin?: Required @@ -1481,7 +1481,7 @@ function getPipelineToRenderTextureToRGB8UnormTexture( } type LinearCopyParameters = { - dataLayout: Required; + dataLayout: Required; origin: Required; data: Uint8Array; }; @@ -1511,7 +1511,7 @@ export function TextureTestMixin>( } expectTexelViewComparisonIsOkInTexture( - src: GPUImageCopyTexture, + src: GPUTexelCopyTextureInfo, exp: TexelView, size: GPUExtent3D, comparisonOptions = { @@ -1526,7 +1526,7 @@ export function TextureTestMixin>( } expectSinglePixelComparisonsAreOkInTexture( - src: GPUImageCopyTexture, + src: GPUTexelCopyTextureInfo, exp: PerPixelComparison[], comparisonOptions = { maxIntDiff: 0, @@ -1836,7 +1836,7 @@ export function TextureTestMixin>( /** Offset for a particular texel in the linear texture data */ getTexelOffsetInBytes( - textureDataLayout: Required, + textureDataLayout: Required, format: ColorTextureFormat, texel: Required, origin: Required = { x: 0, y: 0, z: 0 } diff --git a/src/webgpu/util/copy_to_texture.ts b/src/webgpu/util/copy_to_texture.ts index a96ee8d77e79..fdbc5259724f 100644 --- a/src/webgpu/util/copy_to_texture.ts +++ b/src/webgpu/util/copy_to_texture.ts @@ -169,8 +169,8 @@ export class TextureUploadingUtils extends TextureTestMixin(GPUTest) { } doTestAndCheckResult( - imageCopyExternalImage: GPUImageCopyExternalImage, - dstTextureCopyView: GPUImageCopyTextureTagged, + imageCopyExternalImage: GPUCopyExternalImageSourceInfo, + dstTextureCopyView: GPUCopyExternalImageDestInfo, expTexelView: TexelView, copySize: Required, texelCompareOptions: TexelCompareOptions diff --git a/src/webgpu/util/texture.ts b/src/webgpu/util/texture.ts index 745190d3331a..dde53ff765dc 100644 --- a/src/webgpu/util/texture.ts +++ b/src/webgpu/util/texture.ts @@ -318,9 +318,9 @@ const s_copyBufferToTextureViaRenderPipelines = new WeakMap< function copyBufferToTextureViaRender( t: GPUTest, encoder: GPUCommandEncoder, - source: GPUImageCopyBuffer, + source: GPUTexelCopyBufferInfo, sourceFormat: GPUTextureFormat, - dest: GPUImageCopyTexture, + dest: GPUTexelCopyTextureInfo, size: GPUExtent3D ) { const { format: textureFormat, sampleCount } = dest.texture; diff --git a/src/webgpu/util/texture/layout.ts b/src/webgpu/util/texture/layout.ts index 24a0cdf0040e..8c6c101ae014 100644 --- a/src/webgpu/util/texture/layout.ts +++ b/src/webgpu/util/texture/layout.ts @@ -291,7 +291,7 @@ function validateRowsPerImage({ } interface DataBytesForCopyArgs { - layout: GPUImageDataLayout; + layout: GPUTexelCopyBufferLayout; format: SizedTextureFormat; copySize: Readonly | readonly number[]; method: ImageCopyType; diff --git a/src/webgpu/util/texture/texture_ok.ts b/src/webgpu/util/texture/texture_ok.ts index abfec1f1d7c2..3eb94c2deea0 100644 --- a/src/webgpu/util/texture/texture_ok.ts +++ b/src/webgpu/util/texture/texture_ok.ts @@ -167,7 +167,7 @@ function comparePerComponent( /** Create a new mappable GPUBuffer, and copy a subrectangle of GPUTexture data into it. */ function createTextureCopyForMapRead( t: GPUTest, - source: GPUImageCopyTexture, + source: GPUTexelCopyTextureInfo, copySize: GPUExtent3D, { format }: { format: EncodableTextureFormat } ): { buffer: GPUBuffer; bytesPerRow: number; rowsPerImage: number } { @@ -298,7 +298,7 @@ ${generatePrettyTable(opts, [ */ export async function textureContentIsOKByT2B( t: GPUTest, - source: GPUImageCopyTexture, + source: GPUTexelCopyTextureInfo, copySize_: GPUExtent3D, { expTexelView }: { expTexelView: TexelView }, texelCompareOptions: TexelCompareOptions, diff --git a/src/webgpu/web_platform/copyToTexture/ImageBitmap.spec.ts b/src/webgpu/web_platform/copyToTexture/ImageBitmap.spec.ts index b7638cd08b02..5036c8ef20bc 100644 --- a/src/webgpu/web_platform/copyToTexture/ImageBitmap.spec.ts +++ b/src/webgpu/web_platform/copyToTexture/ImageBitmap.spec.ts @@ -31,17 +31,17 @@ g.test('from_ImageData') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the ImageBitmap contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: - Valid dstFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcFlipYInCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcFlipYInCopy' in cases) And the expected results are all passed. ` @@ -151,10 +151,10 @@ g.test('from_canvas') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the ImageBitmap contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -162,7 +162,7 @@ g.test('from_canvas') - Valid dstFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcFlipYInCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcFlipYInCopy' in cases) And the expected results are all passed. ` @@ -299,10 +299,10 @@ g.test('copy_subrect_from_ImageData') rect info list, to the 0 mipLevel of dst texture, and read the contents out to compare with the ImageBitmap contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped, and origin is top-left consistantly. The tests covers: @@ -310,7 +310,7 @@ g.test('copy_subrect_from_ImageData') - Valid dstFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcFlipYInCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcFlipYInCopy' in cases) - Valid subrect copies. And the expected results are all passed. @@ -416,10 +416,10 @@ g.test('copy_subrect_from_2D_Canvas') rect info list, to the 0 mipLevel of dst texture, and read the contents out to compare with the ImageBitmap contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped, and origin is top-left consistantly. The tests covers: @@ -427,7 +427,7 @@ g.test('copy_subrect_from_2D_Canvas') - Valid dstFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcFlipYInCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcFlipYInCopy' in cases) - Valid subrect copies. And the expected results are all passed. diff --git a/src/webgpu/web_platform/copyToTexture/ImageData.spec.ts b/src/webgpu/web_platform/copyToTexture/ImageData.spec.ts index 03e8f9a893b3..a9a0a441653a 100644 --- a/src/webgpu/web_platform/copyToTexture/ImageData.spec.ts +++ b/src/webgpu/web_platform/copyToTexture/ImageData.spec.ts @@ -24,15 +24,15 @@ g.test('from_ImageData') of dst texture, and read the contents out to compare with the ImageData contents. Expect alpha to get premultiplied in the copy if, and only if, 'premultipliedAlpha' - in 'GPUImageCopyTextureTagged' is set to 'true'. + in 'GPUCopyExternalImageDestInfo' is set to 'true'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: - Valid dstColorFormat of copyExternalImageToTexture() - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) And the expected results are all passed. ` @@ -130,16 +130,16 @@ g.test('copy_subrect_from_ImageData') with the ImageBitmap contents. Expect alpha to get premultiplied in the copy if, and only if, 'premultipliedAlpha' - in 'GPUImageCopyTextureTagged' is set to 'true'. + in 'GPUCopyExternalImageDestInfo' is set to 'true'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped, and origin is top-left consistantly. The tests covers: - Source WebGPU Canvas lives in the same GPUDevice or different GPUDevice as test - Valid dstColorFormat of copyExternalImageToTexture() - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - Valid subrect copies. And the expected results are all passed. diff --git a/src/webgpu/web_platform/copyToTexture/canvas.spec.ts b/src/webgpu/web_platform/copyToTexture/canvas.spec.ts index 210a63abaff9..84334df603e3 100644 --- a/src/webgpu/web_platform/copyToTexture/canvas.spec.ts +++ b/src/webgpu/web_platform/copyToTexture/canvas.spec.ts @@ -466,10 +466,10 @@ g.test('copy_contents_from_2d_context_canvas') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the canvas contents. - Provide premultiplied input if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Provide premultiplied input if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and unpremultiplied input if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -477,7 +477,7 @@ g.test('copy_contents_from_2d_context_canvas') - Valid 2d context type - Valid dstColorFormat of copyExternalImageToTexture() - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - TODO(#913): color space tests need to be added And the expected results are all passed. @@ -527,10 +527,10 @@ g.test('copy_contents_from_gl_context_canvas') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the canvas contents. - Provide premultiplied input if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Provide premultiplied input if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and unpremultiplied input if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -539,7 +539,7 @@ g.test('copy_contents_from_gl_context_canvas') - Valid dstColorFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage'(named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo'(named 'srcDoFlipYDuringCopy' in cases) - TODO: color space tests need to be added And the expected results are all passed. @@ -595,10 +595,10 @@ g.test('copy_contents_from_gpu_context_canvas') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the canvas contents. - Provide premultiplied input if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Provide premultiplied input if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and unpremultiplied input if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -607,7 +607,7 @@ g.test('copy_contents_from_gpu_context_canvas') - Valid dstColorFormat of copyExternalImageToTexture() - TODO: test more source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage'(named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo'(named 'srcDoFlipYDuringCopy' in cases) - TODO: color space tests need to be added And the expected results are all passed. @@ -665,10 +665,10 @@ g.test('copy_contents_from_bitmaprenderer_context_canvas') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the canvas contents. - Provide premultiplied input if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Provide premultiplied input if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and unpremultiplied input if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -676,7 +676,7 @@ g.test('copy_contents_from_bitmaprenderer_context_canvas') - Valid ImageBitmapRendering context type - Valid dstColorFormat of copyExternalImageToTexture() - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - TODO(#913): color space tests need to be added And the expected results are all passed. @@ -736,10 +736,10 @@ g.test('color_space_conversion') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the canvas contents. - Provide premultiplied input if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Provide premultiplied input if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and unpremultiplied input if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. If color space from source input and user defined dstTexture color space are different, the @@ -748,7 +748,7 @@ g.test('color_space_conversion') The tests covers: - Valid dstColorFormat of copyExternalImageToTexture() - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - Valid 'colorSpace' config in 'dstColorSpace' And the expected results are all passed. diff --git a/src/webgpu/web_platform/copyToTexture/image.spec.ts b/src/webgpu/web_platform/copyToTexture/image.spec.ts index 2bb6eab8f176..7bb577ae5d07 100644 --- a/src/webgpu/web_platform/copyToTexture/image.spec.ts +++ b/src/webgpu/web_platform/copyToTexture/image.spec.ts @@ -35,10 +35,10 @@ g.test('from_image') Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the HTMLImageElement contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: @@ -46,7 +46,7 @@ g.test('from_image') - Valid dstColorFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) And the expected results are all passed. ` @@ -229,10 +229,10 @@ g.test('copy_subrect_from_2D_Canvas') rect info list, to the 0 mipLevel of dst texture, and read the contents out to compare with the HTMLImageElement contents. - Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUImageCopyTextureTagged' + Do premultiply alpha during copy if 'premultipliedAlpha' in 'GPUCopyExternalImageDestInfo' is set to 'true' and do unpremultiply alpha if it is set to 'false'. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped, and origin is top-left consistantly. The tests covers: @@ -240,7 +240,7 @@ g.test('copy_subrect_from_2D_Canvas') - Valid dstColorFormat of copyExternalImageToTexture() - Valid source image alphaMode - Valid dest alphaMode - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - Valid subrect copies. And the expected results are all passed. diff --git a/src/webgpu/web_platform/copyToTexture/video.spec.ts b/src/webgpu/web_platform/copyToTexture/video.spec.ts index e6e641d982e3..c5e2695f79a9 100644 --- a/src/webgpu/web_platform/copyToTexture/video.spec.ts +++ b/src/webgpu/web_platform/copyToTexture/video.spec.ts @@ -34,12 +34,12 @@ It creates HTMLVideoElement with videos under Resource folder. Then call copyExternalImageToTexture() to do a full copy to the 0 mipLevel of dst texture, and read the contents out to compare with the ImageBitmap contents. - If 'flipY' in 'GPUImageCopyExternalImage' is set to 'true', copy will ensure the result + If 'flipY' in 'GPUCopyExternalImageSourceInfo' is set to 'true', copy will ensure the result is flipped. The tests covers: - Video comes from different color spaces. - - Valid 'flipY' config in 'GPUImageCopyExternalImage' (named 'srcDoFlipYDuringCopy' in cases) + - Valid 'flipY' config in 'GPUCopyExternalImageSourceInfo' (named 'srcDoFlipYDuringCopy' in cases) - TODO: partial copy tests should be added - TODO: all valid dstColorFormat tests should be added. `