Skip to content

Commit 3b55cf9

Browse files
fix(metal): Don't panic on OOM in create_buffer (gfx-rs#8994)
1 parent 8355603 commit 3b55cf9

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

cts_runner/test.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ webgpu:api,operation,vertex_state,correctness:setVertexBuffer_offset_and_attribu
5656
webgpu:api,validation,buffer,create:*
5757
webgpu:api,validation,buffer,destroy:*
5858
webgpu:api,validation,capability_checks,limits,maxBindGroups:setBindGroup,*
59+
webgpu:api,validation,capability_checks,limits,maxBufferSize:*
5960
//FAIL: other `maxInterStageShaderVariables` cases w/ limitTest ∈ [underDefault, overMaximum]
6061
// https://github.com/gfx-rs/wgpu/issues/8945
6162
webgpu:api,validation,capability_checks,limits,maxInterStageShaderVariables:createRenderPipeline,at_over:limitTest="atDefault";*

wgpu-hal/src/metal/device.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ impl crate::Device for super::Device {
418418
.shared
419419
.device
420420
.newBufferWithLength_options(desc.size as usize, options)
421-
.unwrap();
421+
.ok_or(crate::DeviceError::OutOfMemory)?;
422422
if let Some(label) = desc.label {
423423
raw.setLabel(Some(&NSString::from_str(label)));
424424
}

0 commit comments

Comments
 (0)