diff --git a/wgpu-native/src/command/bind.rs b/wgpu-native/src/command/bind.rs index d1d5edafa4..517ed0720c 100644 --- a/wgpu-native/src/command/bind.rs +++ b/wgpu-native/src/command/bind.rs @@ -1,4 +1,4 @@ -use crate::{BindGroupHandle, BindGroupId, BindGroupLayoutId, PipelineLayoutId, Stored}; +use crate::{BindGroupHandle, BindGroupId, BindGroupLayoutId, BufferAddress, PipelineLayoutId, Stored}; use log::trace; @@ -50,7 +50,7 @@ impl BindGroupEntry { &mut self, bind_group_id: BindGroupId, bind_group: &BindGroupHandle, - offsets: &[u32], + offsets: &[BufferAddress], ) -> Provision { let was_compatible = match self.provided { Some(BindGroupPair { @@ -140,7 +140,7 @@ impl Binder { index: usize, bind_group_id: BindGroupId, bind_group: &BindGroupHandle, - offsets: &[u32], + offsets: &[BufferAddress], ) -> Option<(PipelineLayoutId, impl 'a + Iterator)> { trace!("\tBinding [{}] = group {:?}", index, bind_group_id); match self.entries[index].provide(bind_group_id, bind_group, offsets) { diff --git a/wgpu-native/src/command/compute.rs b/wgpu-native/src/command/compute.rs index 8b9b442db6..b94563c49e 100644 --- a/wgpu-native/src/command/compute.rs +++ b/wgpu-native/src/command/compute.rs @@ -3,6 +3,7 @@ use crate::{ hub::HUB, track::{Stitch, TrackerSet}, BindGroupId, + BufferAddress, CommandBuffer, CommandBufferId, ComputePassId, @@ -53,7 +54,7 @@ pub extern "C" fn wgpu_compute_pass_set_bind_group( pass_id: ComputePassId, index: u32, bind_group_id: BindGroupId, - offsets_ptr: *const u32, + offsets_ptr: *const BufferAddress, offsets_count: usize, ) { let mut pass_guard = HUB.compute_passes.write(); @@ -92,7 +93,7 @@ pub extern "C" fn wgpu_compute_pass_set_bind_group( &pipeline_layout_guard[pipeline_layout_id].raw, index as usize, bind_groups, - offsets, + offsets.iter().map(|&off| off as hal::command::DescriptorSetOffset), ); } }; diff --git a/wgpu-native/src/command/render.rs b/wgpu-native/src/command/render.rs index 14b2390afb..a4e4590b38 100644 --- a/wgpu-native/src/command/render.rs +++ b/wgpu-native/src/command/render.rs @@ -140,7 +140,7 @@ pub extern "C" fn wgpu_render_pass_set_bind_group( pass_id: RenderPassId, index: u32, bind_group_id: BindGroupId, - offsets_ptr: *const u32, + offsets_ptr: *const BufferAddress, offsets_count: usize, ) { let mut pass_guard = HUB.render_passes.write(); @@ -169,7 +169,7 @@ pub extern "C" fn wgpu_render_pass_set_bind_group( &&pipeline_layout_guard[pipeline_layout_id].raw, index as usize, bind_groups, - offsets, + offsets.iter().map(|&off| off as hal::command::DescriptorSetOffset), ); } }; @@ -225,7 +225,7 @@ pub extern "C" fn wgpu_render_pass_set_index_buffer( pub extern "C" fn wgpu_render_pass_set_vertex_buffers( pass_id: RenderPassId, buffer_ptr: *const BufferId, - offset_ptr: *const u32, + offset_ptr: *const BufferAddress, count: usize, ) { let mut pass_guard = HUB.render_passes.write(); @@ -244,7 +244,7 @@ pub extern "C" fn wgpu_render_pass_set_vertex_buffers( let buffers = buffers .iter() .map(|&id| &buffer_guard[id].raw) - .zip(offsets.iter().map(|&off| off as u64)); + .zip(offsets.iter().cloned()); unsafe { pass.raw.bind_vertex_buffers(0, buffers);