mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
Fix tracking of the set_sub_data service command buffer
This commit is contained in:
parent
76473bb38a
commit
8ad1476872
@ -212,7 +212,7 @@ pub extern "C" fn wgpu_render_pass_set_pipeline(
|
||||
|
||||
let pipeline_layout_guard = HUB.pipeline_layouts.read();
|
||||
let pipeline_layout = &pipeline_layout_guard[pipeline.layout_id];
|
||||
let bing_group_guard = HUB.bind_groups.read();
|
||||
let bind_group_guard = HUB.bind_groups.read();
|
||||
|
||||
pass.binder.pipeline_layout_id = Some(pipeline.layout_id.clone());
|
||||
pass.binder.ensure_length(pipeline_layout.bind_group_layout_ids.len());
|
||||
@ -223,7 +223,7 @@ pub extern "C" fn wgpu_render_pass_set_pipeline(
|
||||
.enumerate()
|
||||
{
|
||||
if let Some(bg_id) = entry.expect_layout(bgl_id) {
|
||||
let desc_set = &bing_group_guard[bg_id].raw;
|
||||
let desc_set = &bind_group_guard[bg_id].raw;
|
||||
unsafe {
|
||||
pass.raw.bind_graphics_descriptor_sets(
|
||||
&pipeline_layout.raw,
|
||||
|
@ -1659,7 +1659,12 @@ pub extern "C" fn wgpu_buffer_set_sub_data(
|
||||
range: None .. None, //TODO: could be partial
|
||||
});
|
||||
|
||||
// Note: this is not pretty. If we need one-time service command buffers,
|
||||
// we'll need to have some internal abstractions for them to be safe.
|
||||
let mut comb = device.com_allocator.allocate(buffer.device_id.clone(), &device.raw);
|
||||
// mark as used by the next submission, conservatively
|
||||
let last_submit_index = device.life_guard.submission_index.load(Ordering::Acquire);
|
||||
comb.life_guard.submission_index.store(last_submit_index + 1, Ordering::Release);
|
||||
unsafe {
|
||||
let raw = comb.raw.last_mut().unwrap();
|
||||
raw.begin(
|
||||
|
Loading…
Reference in New Issue
Block a user