Skip to content

Commit

Permalink
fix todo lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Dec 11, 2023
1 parent 7a79e3f commit cb7e9a9
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions crates/re_renderer/src/allocator/cpu_write_gpu_read_belt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,12 @@ pub struct CpuWriteGpuReadBuffer<T: bytemuck::Pod + Send + Sync> {
_type: std::marker::PhantomData<T>,
}

// BufferViewMut is not Send/Sync right now because `BufferMappedRange` trait does not implement Send/Sync.
// However, on native it is always Send/Sync, see https://github.com/gfx-rs/wgpu/issues/3795#issuecomment-1561189339
// and on web we're single threaded.
//
// https://github.com/gfx-rs/wgpu/issues/3795 is resolved, we force Send+Sync here.

#[allow(unsafe_code)]
// SAFETY: TODO(https://github.com/gfx-rs/wgpu/pull/4818): Upstream wgpu allows `wgpu::BufferViewMut` to be Send.
// SAFETY: TODO(gfx-rs/wgpu#4818): Upstream wgpu allows `wgpu::BufferViewMut` to be Send.
unsafe impl<T> Send for CpuWriteGpuReadBuffer<T> where T: bytemuck::Pod + Send + Sync {}

#[allow(unsafe_code)]
// SAFETY: TODO(https://github.com/gfx-rs/wgpu/pull/4818): Upstream wgpu allows `wgpu::BufferViewMut` to be Sync.
// SAFETY: TODO(gfx-rs/wgpu#4818): Upstream wgpu allows `wgpu::BufferViewMut` to be Sync.
unsafe impl<T> Sync for CpuWriteGpuReadBuffer<T> where T: bytemuck::Pod + Send + Sync {}

impl<T> CpuWriteGpuReadBuffer<T>
Expand Down

0 comments on commit cb7e9a9

Please sign in to comment.