mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
remove CommandBuffer.limits
This commit is contained in:
parent
d3eed4920b
commit
9b4bb8b594
@ -892,7 +892,6 @@ impl<A: HalApi> BindGroup<A> {
|
||||
&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<A: HalApi> BindGroup<A> {
|
||||
.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,
|
||||
|
@ -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
|
||||
|
@ -305,7 +305,6 @@ impl<A: HalApi> CommandBufferMutable<A> {
|
||||
/// whose contents eventually become the property of the submission queue.
|
||||
pub struct CommandBuffer<A: HalApi> {
|
||||
pub(crate) device: Arc<Device<A>>,
|
||||
limits: wgt::Limits,
|
||||
support_clear_texture: bool,
|
||||
pub(crate) info: ResourceInfo<CommandBuffer<A>>,
|
||||
|
||||
@ -344,7 +343,6 @@ impl<A: HalApi> CommandBuffer<A> {
|
||||
) -> 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(
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user