diff --git a/wgpu-hal/src/metal/command.rs b/wgpu-hal/src/metal/command.rs index 4f2402338..5ae5fe41f 100644 --- a/wgpu-hal/src/metal/command.rs +++ b/wgpu-hal/src/metal/command.rs @@ -1,6 +1,7 @@ use super::{conv, AsNative}; use std::{mem, ops::Range}; +// has to match `Temp::binding_sizes` const WORD_SIZE: usize = 4; impl Default for super::CommandState { @@ -63,15 +64,15 @@ impl super::CommandState { fn make_sizes_buffer_update<'a>( &self, stage: naga::ShaderStage, - result_sizes: &'a mut Vec, - ) -> Option<(u32, &'a [wgt::BufferSize])> { + result_sizes: &'a mut Vec, + ) -> Option<(u32, &'a [u32])> { let stage_info = &self.stage_infos[stage]; let slot = stage_info.sizes_slot?; result_sizes.clear(); for br in stage_info.sized_bindings.iter() { // If it's None, this isn't the right time to update the sizes let size = self.storage_buffer_length_map.get(br)?; - result_sizes.push(*size); + result_sizes.push(size.get().min(!0u32 as u64) as u32); } Some((slot as _, result_sizes)) } diff --git a/wgpu-hal/src/metal/mod.rs b/wgpu-hal/src/metal/mod.rs index e4d18aeb0..e8b2a3868 100644 --- a/wgpu-hal/src/metal/mod.rs +++ b/wgpu-hal/src/metal/mod.rs @@ -691,7 +691,7 @@ struct IndexState { #[derive(Default)] struct Temp { - binding_sizes: Vec, + binding_sizes: Vec, } struct CommandState {