-
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.
Fix crash when
Device::generateAnOutOfMemoryError
is repeatedly inv…
…oked https://bugs.webkit.org/show_bug.cgi?id=270991 rdar://124475321 Reviewed by Mike Wyrzykowski. `m_uncapturedErrorCallback` can only be called once, so it should always be cleared after calling it. * LayoutTests/fast/webgpu/repeated-out-of-memory-error-expected.txt: Added. * LayoutTests/fast/webgpu/repeated-out-of-memory-error.html: Added. * Source/WebGPU/WebGPU/Device.mm: (WebGPU::Device::generateAnOutOfMemoryError): (WebGPU::Device::generateAnInternalError): Canonical link: https://commits.webkit.org/276135@main
- Loading branch information
1 parent
86e114a
commit 56e388b
Showing
3 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
LayoutTests/fast/webgpu/repeated-out-of-memory-error-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 @@ | ||
This test passes if it does not crash. |
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,83 @@ | ||
This test passes if it does not crash. | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.waitUntilDone(); | ||
testRunner.dumpAsText(); | ||
} | ||
|
||
onload = async () => { | ||
try { | ||
let adapter0 = await navigator.gpu.requestAdapter( | ||
{ | ||
powerPreference: 'high-performance', | ||
} | ||
); | ||
let device0 = await adapter0.requestDevice( | ||
{ | ||
label: '\u{1fc7e}', | ||
requiredFeatures: [ | ||
'depth-clip-control', | ||
'shader-f16', | ||
'bgra8unorm-storage' | ||
], | ||
requiredLimits: { | ||
maxColorAttachmentBytesPerSample: 60, | ||
maxVertexAttributes: 30, | ||
maxVertexBufferArrayStride: 11348, | ||
maxStorageTexturesPerShaderStage: 42, | ||
maxBindingsPerBindGroup: 7372, | ||
maxTextureArrayLayers: 2011 | ||
}, | ||
} | ||
); | ||
let bindGroupLayout0 = device0.createBindGroupLayout( | ||
{ | ||
entries: [ | ||
{ | ||
binding: 5869, | ||
visibility: GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT, | ||
texture: { viewDimension: '2d', sampleType: 'float', multisampled: false }, | ||
} | ||
], | ||
} | ||
); | ||
device0.addEventListener('uncapturederror', e => { e.label = device0.label; }); | ||
device0.createTexture( | ||
{ | ||
label: '\u04ab', | ||
size: { | ||
width: 7798, | ||
height: 7120, | ||
depthOrArrayLayers: 377, | ||
}, | ||
format: 'stencil8', | ||
usage: GPUTextureUsage.COPY_SRC | GPUTextureUsage.COPY_DST, | ||
} | ||
); | ||
let sampler5 = device0.createSampler( | ||
{ | ||
addressModeU: 'repeat', | ||
addressModeV: 'mirror-repeat', | ||
addressModeW: 'mirror-repeat', | ||
minFilter: 'nearest', | ||
lodMinClamp: 45.683, | ||
lodMaxClamp: 77.763, | ||
compare: 'always', | ||
} | ||
); | ||
let bindGroup0 = device0.createBindGroup( | ||
{ | ||
layout: bindGroupLayout0, | ||
entries: [ | ||
{ | ||
binding: 646, | ||
resource: sampler5, | ||
} | ||
], | ||
} | ||
); | ||
} catch (e) { } | ||
if (window.testRunner) | ||
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