-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WebGPU] Device::hasFeature() and Adapter::hasFeature() only check th…
…at list is not empty https://bugs.webkit.org/show_bug.cgi?id=274664 <radar://128671215> Reviewed by Tadeu Zagallo. std::find here was incorrect, we can use contains() instead however. * LayoutTests/TestExpectations: * LayoutTests/fast/webgpu/regression/repro_274664-expected.txt: Added. * LayoutTests/fast/webgpu/regression/repro_274664.html: Added. * LayoutTests/fast/webgpu/regression/repro_274664b-expected.txt: Added. * LayoutTests/fast/webgpu/regression/repro_274664b.html: Added. * LayoutTests/fast/webgpu/regression/repro_274664c-expected.txt: Added. * LayoutTests/fast/webgpu/regression/repro_274664c.html: Added. Add regression test. * Source/WebGPU/WebGPU/Adapter.mm: (WebGPU::Adapter::hasFeature): * Source/WebGPU/WebGPU/Device.mm: (WebGPU::Device::hasFeature const): Canonical link: https://commits.webkit.org/279293@main
- Loading branch information
1 parent
fc1a727
commit 862497b
Showing
9 changed files
with
83 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CONSOLE MESSAGE: rg11b10ufloat | ||
CONSOLE MESSAGE: createTexture: descriptor.usage & WGPUTextureUsage_RenderAttachment && !isRenderableFormat(descriptor.format, *this) | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x600 | ||
RenderBlock {HTML} at (0,0) size 800x600 | ||
RenderBody {BODY} at (8,8) size 784x584 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script> | ||
globalThis.testRunner?.waitUntilDone(); | ||
const log = console.debug; | ||
|
||
onload = async () => { | ||
let adapter = await navigator.gpu.requestAdapter({}); | ||
let device = await adapter.requestDevice({requiredFeatures: ['depth32float-stencil8']}); | ||
device.pushErrorScope('validation'); | ||
let texture = device.createTexture({format: 'rg11b10ufloat', size: [1, 1, 1], usage: GPUTextureUsage.RENDER_ATTACHMENT}); | ||
log(texture.format); | ||
let error = await device.popErrorScope(); | ||
if (error) { | ||
log(error.message); | ||
} else { | ||
log(`no validation error`); | ||
} | ||
globalThis.testRunner?.notifyDone(); | ||
}; | ||
</script> |
7 changes: 7 additions & 0 deletions
7
LayoutTests/fast/webgpu/regression/repro_274664b-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CONSOLE MESSAGE: rg11b10ufloat | ||
CONSOLE MESSAGE: createTexture: descriptor.usage & WGPUTextureUsage_RenderAttachment && !isRenderableFormat(descriptor.format, *this) | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x600 | ||
RenderBlock {HTML} at (0,0) size 800x600 | ||
RenderBody {BODY} at (8,8) size 784x584 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script> | ||
globalThis.testRunner?.waitUntilDone(); | ||
const log = console.debug; | ||
|
||
onload = async () => { | ||
let adapter = await navigator.gpu.requestAdapter({}); | ||
let device = await adapter.requestDevice({}); | ||
device.pushErrorScope('validation'); | ||
let texture = device.createTexture({format: 'rg11b10ufloat', size: [1, 1, 1], usage: GPUTextureUsage.RENDER_ATTACHMENT}); | ||
log(texture.format); | ||
let error = await device.popErrorScope(); | ||
if (error) { | ||
log(error.message); | ||
} else { | ||
log(`no validation error`); | ||
} | ||
globalThis.testRunner?.notifyDone(); | ||
}; | ||
</script> |
7 changes: 7 additions & 0 deletions
7
LayoutTests/fast/webgpu/regression/repro_274664c-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CONSOLE MESSAGE: rg11b10ufloat | ||
CONSOLE MESSAGE: no validation error | ||
layer at (0,0) size 800x600 | ||
RenderView at (0,0) size 800x600 | ||
layer at (0,0) size 800x600 | ||
RenderBlock {HTML} at (0,0) size 800x600 | ||
RenderBody {BODY} at (8,8) size 784x584 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script> | ||
globalThis.testRunner?.waitUntilDone(); | ||
const log = console.debug; | ||
|
||
onload = async () => { | ||
let adapter = await navigator.gpu.requestAdapter({}); | ||
let device = await adapter.requestDevice({requiredFeatures: ['rg11b10ufloat-renderable']}); | ||
device.pushErrorScope('validation'); | ||
let texture = device.createTexture({format: 'rg11b10ufloat', size: [1, 1, 1], usage: GPUTextureUsage.RENDER_ATTACHMENT}); | ||
log(texture.format); | ||
let error = await device.popErrorScope(); | ||
if (error) { | ||
log(error.message); | ||
} else { | ||
log(`no validation error`); | ||
} | ||
globalThis.testRunner?.notifyDone(); | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters