diff --git a/wgpu-core/src/binding_model.rs b/wgpu-core/src/binding_model.rs index a64fe78465..3443bcf782 100644 --- a/wgpu-core/src/binding_model.rs +++ b/wgpu-core/src/binding_model.rs @@ -892,7 +892,6 @@ impl BindGroup { &self, bind_group_index: u32, offsets: &[wgt::DynamicOffset], - limits: &wgt::Limits, ) -> Result<(), BindError> { if self.dynamic_binding_info.len() != offsets.len() { return Err(BindError::MismatchedDynamicOffsetCount { @@ -908,7 +907,8 @@ impl BindGroup { .zip(offsets.iter()) .enumerate() { - let (alignment, limit_name) = buffer_binding_type_alignment(limits, info.binding_type); + let (alignment, limit_name) = + buffer_binding_type_alignment(&self.device.limits, info.binding_type); if offset as wgt::BufferAddress % alignment as u64 != 0 { return Err(BindError::UnalignedDynamicBinding { group: bind_group_index, diff --git a/wgpu-core/src/command/compute.rs b/wgpu-core/src/command/compute.rs index 4c6e005d46..533383c633 100644 --- a/wgpu-core/src/command/compute.rs +++ b/wgpu-core/src/command/compute.rs @@ -592,7 +592,7 @@ impl Global { bind_group.same_device_as(cmd_buf).map_pass_err(scope)?; - let max_bind_groups = cmd_buf.limits.max_bind_groups; + let max_bind_groups = state.device.limits.max_bind_groups; if index >= max_bind_groups { return Err(ComputePassErrorInner::BindGroupIndexOutOfRange { index, @@ -610,7 +610,7 @@ impl Global { let bind_group = state.tracker.bind_groups.insert_single(bind_group); bind_group - .validate_dynamic_bindings(index, &state.temp_offsets, &cmd_buf.limits) + .validate_dynamic_bindings(index, &state.temp_offsets) .map_pass_err(scope)?; state.buffer_memory_init_actions.extend( @@ -766,7 +766,8 @@ impl Global { state.flush_states(raw, None).map_pass_err(scope)?; - let groups_size_limit = cmd_buf.limits.max_compute_workgroups_per_dimension; + let groups_size_limit = + state.device.limits.max_compute_workgroups_per_dimension; if groups[0] > groups_size_limit || groups[1] > groups_size_limit diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index b237a375a6..b4669f8e7a 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -305,7 +305,6 @@ impl CommandBufferMutable { /// whose contents eventually become the property of the submission queue. pub struct CommandBuffer { pub(crate) device: Arc>, - limits: wgt::Limits, support_clear_texture: bool, pub(crate) info: ResourceInfo>, @@ -344,7 +343,6 @@ impl CommandBuffer { ) -> Self { CommandBuffer { device: device.clone(), - limits: device.limits.clone(), support_clear_texture: device.features.contains(wgt::Features::CLEAR_TEXTURE), info: ResourceInfo::new(label, None), data: Mutex::new( diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 2508ae26f7..e2721e71d1 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -1522,7 +1522,7 @@ impl Global { .map_pass_err(scope)?; bind_group - .validate_dynamic_bindings(index, &temp_offsets, &cmd_buf.limits) + .validate_dynamic_bindings(index, &temp_offsets) .map_pass_err(scope)?; // merge the resource tracker in