webgpu: renovate gpucanvascontext and webgpu presentation to match the spec (#33521)

* Reimpl gpucanvascontext

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* ValidateTextureDescriptorAndCreateSwapChain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reconfigure

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* resize

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* work around deadlocks in wgpu core

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* match spec even more by moving all swapchain operations into one updatecontext

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* error handling

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* enable one test

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* label dummy texture

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* clean some expectation (they are not flaky anymore)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* one more

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* change for configuration change in update_wr_image

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* DEFAULT_IMAGE_FORMAT

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* introduce WebGPUImageDescriptor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
Samson 2024-10-01 12:03:11 +02:00 committed by GitHub
parent 0b2549f4cb
commit 05ecb8eddb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 795 additions and 483 deletions

View file

@ -9741,8 +9741,6 @@
[:format="bc1-rgba-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc1-rgba-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc1-rgba-unorm-srgb";canvasType="offscreen";enable_required_feature=false]
@ -9751,8 +9749,6 @@
[:format="bc1-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=false]
[:format="bc1-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc2-rgba-unorm";canvasType="offscreen";enable_required_feature=false]
@ -9761,8 +9757,6 @@
[:format="bc2-rgba-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc2-rgba-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc2-rgba-unorm-srgb";canvasType="offscreen";enable_required_feature=false]
@ -9771,8 +9765,6 @@
[:format="bc2-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=false]
[:format="bc2-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc3-rgba-unorm";canvasType="offscreen";enable_required_feature=false]
@ -9781,8 +9773,6 @@
[:format="bc3-rgba-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc3-rgba-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc3-rgba-unorm-srgb";canvasType="offscreen";enable_required_feature=false]
@ -9791,8 +9781,6 @@
[:format="bc3-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=false]
[:format="bc3-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc4-r-snorm";canvasType="offscreen";enable_required_feature=false]
@ -9801,8 +9789,6 @@
[:format="bc4-r-snorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc4-r-snorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc4-r-unorm";canvasType="offscreen";enable_required_feature=false]
@ -9811,8 +9797,6 @@
[:format="bc4-r-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc4-r-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc5-rg-snorm";canvasType="offscreen";enable_required_feature=false]
@ -9821,8 +9805,6 @@
[:format="bc5-rg-snorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc5-rg-snorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc5-rg-unorm";canvasType="offscreen";enable_required_feature=false]
@ -9831,8 +9813,6 @@
[:format="bc5-rg-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc5-rg-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc6h-rgb-float";canvasType="offscreen";enable_required_feature=false]
@ -9841,8 +9821,6 @@
[:format="bc6h-rgb-float";canvasType="onscreen";enable_required_feature=false]
[:format="bc6h-rgb-float";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc6h-rgb-ufloat";canvasType="offscreen";enable_required_feature=false]
@ -9851,8 +9829,6 @@
[:format="bc6h-rgb-ufloat";canvasType="onscreen";enable_required_feature=false]
[:format="bc6h-rgb-ufloat";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc7-rgba-unorm";canvasType="offscreen";enable_required_feature=false]
@ -9861,8 +9837,6 @@
[:format="bc7-rgba-unorm";canvasType="onscreen";enable_required_feature=false]
[:format="bc7-rgba-unorm";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="bc7-rgba-unorm-srgb";canvasType="offscreen";enable_required_feature=false]
@ -9871,8 +9845,6 @@
[:format="bc7-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=false]
[:format="bc7-rgba-unorm-srgb";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="depth32float-stencil8";canvasType="offscreen";enable_required_feature=false]
@ -9881,8 +9853,6 @@
[:format="depth32float-stencil8";canvasType="onscreen";enable_required_feature=false]
[:format="depth32float-stencil8";canvasType="onscreen";enable_required_feature=true]
expected:
if os == "linux" and not debug: FAIL
[:format="eac-r11snorm";canvasType="offscreen";enable_required_feature=false]
@ -16934,9 +16904,45 @@
[cts.https.html?q=webgpu:api,validation,capability_checks,limits,maxTextureDimension2D:configure,at_over:*]
disabled: true
expected:
if os == "linux" and not debug: SKIP
[:limitTest="atDefault";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="atDefault";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="atDefault";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="atDefault";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="atMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="atMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="atMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="atMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="overMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="overMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="overMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="overMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="underDefault";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="underDefault";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="underDefault";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="underDefault";testValueName="overLimit";canvasType="onscreen"]
[cts.https.html?q=webgpu:api,validation,capability_checks,limits,maxTextureDimension2D:createTexture,at_over:*]
@ -16962,8 +16968,45 @@
[cts.https.html?q=webgpu:api,validation,capability_checks,limits,maxTextureDimension2D:getCurrentTexture,at_over:*]
expected:
if os == "linux" and not debug: CRASH
[:limitTest="atDefault";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="atDefault";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="atDefault";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="atDefault";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="atMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="atMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="atMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="atMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="betweenDefaultAndMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="overMaximum";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="overMaximum";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="overMaximum";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="overMaximum";testValueName="overLimit";canvasType="onscreen"]
[:limitTest="underDefault";testValueName="atLimit";canvasType="offscreen"]
[:limitTest="underDefault";testValueName="atLimit";canvasType="onscreen"]
[:limitTest="underDefault";testValueName="overLimit";canvasType="offscreen"]
[:limitTest="underDefault";testValueName="overLimit";canvasType="onscreen"]
[cts.https.html?q=webgpu:api,validation,capability_checks,limits,maxTextureDimension3D:createTexture,at_over:*]
@ -185733,60 +185776,32 @@
[:canvasType="onscreen";format="astc-8x8-unorm-srgb"]
[:canvasType="onscreen";format="bc1-rgba-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc1-rgba-unorm-srgb"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc2-rgba-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc2-rgba-unorm-srgb"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc3-rgba-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc3-rgba-unorm-srgb"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc4-r-snorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc4-r-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc5-rg-snorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc5-rg-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc6h-rgb-float"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc6h-rgb-ufloat"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc7-rgba-unorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bc7-rgba-unorm-srgb"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bgra8unorm"]
@ -185863,8 +185878,6 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="r8snorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="r8uint"]
expected:
@ -185875,8 +185888,6 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rg11b10ufloat"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rg16float"]
expected:
@ -185907,8 +185918,6 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rg8snorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rg8uint"]
expected:
@ -185927,8 +185936,6 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgb9e5ufloat"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba16float"]
expected:
@ -185959,8 +185966,6 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba8snorm"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba8uint"]
expected:
@ -185978,13 +185983,23 @@
[cts.https.html?q=webgpu:web_platform,canvas,configure:size_zero_after_configure:*]
expected:
if os == "linux" and not debug: CRASH
[:canvasType="offscreen";zeroDimension="height"]
[:canvasType="offscreen";zeroDimension="width"]
[:canvasType="onscreen";zeroDimension="height"]
[:canvasType="onscreen";zeroDimension="width"]
[cts.https.html?q=webgpu:web_platform,canvas,configure:size_zero_before_configure:*]
expected:
if os == "linux" and not debug: CRASH
[:canvasType="offscreen";zeroDimension="height"]
[:canvasType="offscreen";zeroDimension="width"]
[:canvasType="onscreen";zeroDimension="height"]
[:canvasType="onscreen";zeroDimension="width"]
[cts.https.html?q=webgpu:web_platform,canvas,configure:usage:*]
@ -186027,18 +186042,12 @@
[:canvasType="offscreen";format="rgba8unorm";viewFormatFeature="texture-compression-etc2"]
[:canvasType="onscreen";format="bgra8unorm";viewFormatFeature="_undef_"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bgra8unorm";viewFormatFeature="depth32float-stencil8"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bgra8unorm";viewFormatFeature="texture-compression-astc"]
[:canvasType="onscreen";format="bgra8unorm";viewFormatFeature="texture-compression-bc"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="bgra8unorm";viewFormatFeature="texture-compression-etc2"]
@ -186047,30 +186056,20 @@
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba16float";viewFormatFeature="depth32float-stencil8"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba16float";viewFormatFeature="texture-compression-astc"]
[:canvasType="onscreen";format="rgba16float";viewFormatFeature="texture-compression-bc"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba16float";viewFormatFeature="texture-compression-etc2"]
[:canvasType="onscreen";format="rgba8unorm";viewFormatFeature="_undef_"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba8unorm";viewFormatFeature="depth32float-stencil8"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba8unorm";viewFormatFeature="texture-compression-astc"]
[:canvasType="onscreen";format="rgba8unorm";viewFormatFeature="texture-compression-bc"]
expected:
if os == "linux" and not debug: FAIL
[:canvasType="onscreen";format="rgba8unorm";viewFormatFeature="texture-compression-etc2"]
@ -186082,8 +186081,9 @@
[cts.https.html?q=webgpu:web_platform,canvas,getCurrentTexture:configured:*]
expected:
if os == "linux" and not debug: CRASH
[:canvasType="offscreen"]
[:canvasType="onscreen"]
[cts.https.html?q=webgpu:web_platform,canvas,getCurrentTexture:expiry:*]
@ -186119,8 +186119,9 @@
[cts.https.html?q=webgpu:web_platform,canvas,getCurrentTexture:resize:*]
expected:
if os == "linux" and not debug: CRASH
[:canvasType="offscreen"]
[:canvasType="onscreen"]
[cts.https.html?q=webgpu:web_platform,canvas,getCurrentTexture:single_frames:*]

View file

@ -1,6 +1,3 @@
[canvas_clear.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,6 +1,3 @@
[canvas_colorspace_rgba16float.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH

View file

@ -1,6 +1,3 @@
[canvas_complex_rgba16float_copy.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH

View file

@ -1,6 +1,3 @@
[canvas_complex_rgba16float_draw.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH

View file

@ -1,6 +1,3 @@
[canvas_complex_rgba16float_store.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,3 +1,3 @@
[canvas_complex_rgba8unorm_store.https.html]
expected:
if os == "linux" and not debug: [PASS, FAIL]
if os == "linux" and not debug: PASS

View file

@ -1,3 +1,3 @@
[canvas_composite_alpha_bgra8unorm_opaque_copy.https.html]
expected:
if os == "linux" and not debug: [CRASH, PASS, FAIL]
if os == "linux" and not debug: PASS

View file

@ -1,2 +1,2 @@
[canvas_composite_alpha_bgra8unorm_opaque_draw.https.html]
expected: [CRASH, PASS, FAIL]
expected: PASS

View file

@ -1,2 +1,3 @@
[canvas_composite_alpha_bgra8unorm_premultiplied_copy.https.html]
expected: FAIL
expected:
if os == "linux" and not debug: PASS

View file

@ -1,2 +1,3 @@
[canvas_composite_alpha_bgra8unorm_premultiplied_draw.https.html]
expected: FAIL
expected:
if os == "linux" and not debug: PASS

View file

@ -1,6 +1,3 @@
[canvas_composite_alpha_rgba16float_opaque_copy.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,6 +1,3 @@
[canvas_composite_alpha_rgba16float_opaque_draw.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,6 +1,3 @@
[canvas_composite_alpha_rgba16float_premultiplied_copy.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,6 +1,3 @@
[canvas_composite_alpha_rgba16float_premultiplied_draw.https.html]
expected:
if os == "win": CRASH
if os == "linux" and debug: CRASH
if os == "linux" and not debug: TIMEOUT
if os == "mac": CRASH
if os == "linux" and not debug: FAIL

View file

@ -1,3 +1,3 @@
[canvas_composite_alpha_rgba8unorm_opaque_copy.https.html]
expected:
if os == "linux" and not debug: [CRASH, PASS, FAIL]
if os == "linux" and not debug: PASS

View file

@ -1,3 +1,3 @@
[canvas_composite_alpha_rgba8unorm_opaque_draw.https.html]
expected:
if os == "linux" and not debug: [PASS, FAIL]
if os == "linux" and not debug: PASS

View file

@ -1,2 +1,3 @@
[canvas_composite_alpha_rgba8unorm_premultiplied_copy.https.html]
expected: FAIL
expected:
if os == "linux" and not debug: PASS

View file

@ -1,2 +1,3 @@
[canvas_composite_alpha_rgba8unorm_premultiplied_draw.https.html]
expected: [CRASH, FAIL]
expected:
if os == "linux" and not debug: PASS

View file

@ -1,6 +1,3 @@
[delay_get_texture.https.html]
expected:
if os == "win": FAIL
if os == "linux" and debug: FAIL
if os == "linux" and not debug: [PASS, FAIL]
if os == "mac": FAIL
if os == "linux" and not debug: PASS