mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Don't case the dynamic offsets count to u8 (#5026)
This commit is contained in:
parent
1bc71eb8b2
commit
58fe7eac48
@ -312,7 +312,7 @@ impl RenderBundleEncoder {
|
||||
}
|
||||
|
||||
// Identify the next `num_dynamic_offsets` entries from `base.dynamic_offsets`.
|
||||
let num_dynamic_offsets = num_dynamic_offsets as usize;
|
||||
let num_dynamic_offsets = num_dynamic_offsets;
|
||||
let offsets_range =
|
||||
next_dynamic_offset..next_dynamic_offset + num_dynamic_offsets;
|
||||
next_dynamic_offset = offsets_range.end;
|
||||
@ -819,10 +819,10 @@ impl<A: HalApi> RenderBundle<A> {
|
||||
pipeline_layout.as_ref().unwrap().raw(),
|
||||
index,
|
||||
raw_bg,
|
||||
&offsets[..num_dynamic_offsets as usize],
|
||||
&offsets[..num_dynamic_offsets],
|
||||
)
|
||||
};
|
||||
offsets = &offsets[num_dynamic_offsets as usize..];
|
||||
offsets = &offsets[num_dynamic_offsets..];
|
||||
}
|
||||
RenderCommand::SetPipeline(pipeline_id) => {
|
||||
let render_pipelines = trackers.render_pipelines.read();
|
||||
@ -1404,7 +1404,7 @@ impl<A: HalApi> State<A> {
|
||||
return Some(RenderCommand::SetBindGroup {
|
||||
index: i.try_into().unwrap(),
|
||||
bind_group_id: contents.bind_group.as_info().id(),
|
||||
num_dynamic_offsets: (offsets.end - offsets.start) as u8,
|
||||
num_dynamic_offsets: offsets.end - offsets.start,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -1507,7 +1507,7 @@ pub mod bundle_ffi {
|
||||
|
||||
bundle.base.commands.push(RenderCommand::SetBindGroup {
|
||||
index,
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length,
|
||||
bind_group_id,
|
||||
});
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ use std::{fmt, mem, str};
|
||||
pub enum ComputeCommand {
|
||||
SetBindGroup {
|
||||
index: u32,
|
||||
num_dynamic_offsets: u8,
|
||||
num_dynamic_offsets: usize,
|
||||
bind_group_id: id::BindGroupId,
|
||||
},
|
||||
SetPipeline(id::ComputePipelineId),
|
||||
@ -512,10 +512,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
temp_offsets.clear();
|
||||
temp_offsets.extend_from_slice(
|
||||
&base.dynamic_offsets[dynamic_offset_count
|
||||
..dynamic_offset_count + (num_dynamic_offsets as usize)],
|
||||
&base.dynamic_offsets
|
||||
[dynamic_offset_count..dynamic_offset_count + num_dynamic_offsets],
|
||||
);
|
||||
dynamic_offset_count += num_dynamic_offsets as usize;
|
||||
dynamic_offset_count += num_dynamic_offsets;
|
||||
|
||||
let bind_group = tracker
|
||||
.bind_groups
|
||||
@ -924,7 +924,7 @@ pub mod compute_ffi {
|
||||
|
||||
pass.base.commands.push(ComputeCommand::SetBindGroup {
|
||||
index,
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length,
|
||||
bind_group_id,
|
||||
});
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ pub struct Rect<T> {
|
||||
pub enum RenderCommand {
|
||||
SetBindGroup {
|
||||
index: u32,
|
||||
num_dynamic_offsets: u8,
|
||||
num_dynamic_offsets: usize,
|
||||
bind_group_id: id::BindGroupId,
|
||||
},
|
||||
SetPipeline(id::RenderPipelineId),
|
||||
|
@ -1435,10 +1435,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
|
||||
temp_offsets.clear();
|
||||
temp_offsets.extend_from_slice(
|
||||
&base.dynamic_offsets[dynamic_offset_count
|
||||
..dynamic_offset_count + (num_dynamic_offsets as usize)],
|
||||
&base.dynamic_offsets
|
||||
[dynamic_offset_count..dynamic_offset_count + num_dynamic_offsets],
|
||||
);
|
||||
dynamic_offset_count += num_dynamic_offsets as usize;
|
||||
dynamic_offset_count += num_dynamic_offsets;
|
||||
|
||||
let bind_group = tracker
|
||||
.bind_groups
|
||||
@ -2452,7 +2452,7 @@ pub mod render_ffi {
|
||||
|
||||
pass.base.commands.push(RenderCommand::SetBindGroup {
|
||||
index,
|
||||
num_dynamic_offsets: offset_length.try_into().unwrap(),
|
||||
num_dynamic_offsets: offset_length,
|
||||
bind_group_id,
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user