[metal] Increase MAX_COMMAND_BUFFERS (#7858)

This commit is contained in:
Andy Leiserson 2025-06-27 11:18:40 -07:00 committed by GitHub
parent d13e9f5ebf
commit 768d5f4879
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 3 deletions

View File

@ -5,6 +5,8 @@ webgpu:api,operation,compute,basic:memcpy:*
//FAIL: webgpu:api,operation,compute,basic:large_dispatch:* //FAIL: webgpu:api,operation,compute,basic:large_dispatch:*
webgpu:api,operation,compute_pipeline,overrides:* webgpu:api,operation,compute_pipeline,overrides:*
webgpu:api,operation,device,lost:* webgpu:api,operation,device,lost:*
webgpu:api,validation,encoding,beginComputePass:*
webgpu:api,validation,encoding,beginRenderPass:*
webgpu:api,validation,encoding,cmds,clearBuffer:* webgpu:api,validation,encoding,cmds,clearBuffer:*
webgpu:api,validation,encoding,cmds,compute_pass:set_pipeline:* webgpu:api,validation,encoding,cmds,compute_pass:set_pipeline:*
webgpu:api,validation,encoding,cmds,compute_pass:dispatch_sizes:* webgpu:api,validation,encoding,cmds,compute_pass:dispatch_sizes:*
@ -31,13 +33,22 @@ webgpu:api,validation,encoding,encoder_open_state:render_pass_commands:*
//FAIL: webgpu:api,validation,encoding,encoder_open_state:render_bundle_commands:* //FAIL: webgpu:api,validation,encoding,encoder_open_state:render_bundle_commands:*
// https://github.com/gfx-rs/wgpu/issues/7857 // https://github.com/gfx-rs/wgpu/issues/7857
webgpu:api,validation,encoding,encoder_open_state:compute_pass_commands:* webgpu:api,validation,encoding,encoder_open_state:compute_pass_commands:*
webgpu:api,validation,encoding,beginComputePass:* webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_binding_mismatch:encoderType="compute%20pass";*
webgpu:api,validation,encoding,beginRenderPass:* webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_binding_mismatch:encoderType="render%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_resource_type_mismatch:encoderType="compute%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_resource_type_mismatch:encoderType="render%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_visibility_mismatch:encoderType="compute%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bgl_visibility_mismatch:encoderType="render%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bind_groups_and_pipeline_layout_mismatch:encoderType="compute%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:bind_groups_and_pipeline_layout_mismatch:encoderType="render%20pass";*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:buffer_binding,render_pipeline:*
webgpu:api,validation,encoding,programmable,pipeline_bind_group_compat:sampler_binding,render_pipeline:*
webgpu:api,validation,queue,submit:command_buffer,device_mismatch:* webgpu:api,validation,queue,submit:command_buffer,device_mismatch:*
webgpu:api,validation,queue,submit:command_buffer,duplicate_buffers:* webgpu:api,validation,queue,submit:command_buffer,duplicate_buffers:*
webgpu:api,validation,queue,submit:command_buffer,submit_invalidates:* webgpu:api,validation,queue,submit:command_buffer,submit_invalidates:*
//FAIL: webgpu:api,validation,queue,submit:command_buffer,invalid_submit_invalidates:* //FAIL: webgpu:api,validation,queue,submit:command_buffer,invalid_submit_invalidates:*
// https://github.com/gfx-rs/wgpu/issues/3911#issuecomment-2972995675 // https://github.com/gfx-rs/wgpu/issues/3911#issuecomment-2972995675
webgpu:api,validation,render_pass,render_pass_descriptor:attachments,*
webgpu:api,operation,render_pipeline,overrides:* webgpu:api,operation,render_pipeline,overrides:*
webgpu:api,operation,rendering,basic:clear:* webgpu:api,operation,rendering,basic:clear:*
webgpu:api,operation,rendering,basic:fullscreen_quad:* webgpu:api,operation,rendering,basic:fullscreen_quad:*

View File

@ -10,7 +10,24 @@ use alloc::sync::Arc;
use super::TimestampQuerySupport; use super::TimestampQuerySupport;
const MAX_COMMAND_BUFFERS: u64 = 2048; /// Maximum number of command buffers for `MTLCommandQueue`s that we create.
///
/// If a [new command buffer] is requested when Metal has run out of command
/// buffers, it waits indefinitely for one to become available. If the
/// outstanding command buffers are actively executing on the GPU, this will
/// happen relatively quickly. But if the outstanding command buffers will only
/// be recovered upon GC, and attempting to get a new command buffer prevents
/// forward progress towards that GC, there is a deadlock.
///
/// This is mostly a problem for the CTS, which frequently creates command
/// buffers that it does not submit. It is unclear how likely command buffer
/// exhaustion is in real applications.
///
/// This limit was increased from a previous value of 2048 for
/// <https://bugzilla.mozilla.org/show_bug.cgi?id=1971452>.
///
/// [new command buffer]: https://developer.apple.com/documentation/metal/mtlcommandqueue/makecommandbuffer()?language=objc
const MAX_COMMAND_BUFFERS: u64 = 4096;
unsafe impl Send for super::Adapter {} unsafe impl Send for super::Adapter {}
unsafe impl Sync for super::Adapter {} unsafe impl Sync for super::Adapter {}