Skip to content

Commit

Permalink
[rs] Merge gfx-rs#781
Browse files Browse the repository at this point in the history
781: Mark BufferMappedRange Send/Sync on native r=kvark a=cwfitzgerald

This fixes an issue reported on the matrix where this was causing things to unnecessarily be !Send. There's no reason I can see that this couldn't be Send/Sync as we only use it like one would a slice. We might also consider backporting this to 0.7.

Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
  • Loading branch information
bors[bot] and cwfitzgerald authored Mar 4, 2021
2 parents b53a00e + 9be3031 commit f525302
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wgpu/src/backend/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1910,6 +1910,9 @@ pub struct BufferMappedRange {
size: usize,
}

unsafe impl Send for BufferMappedRange {}
unsafe impl Sync for BufferMappedRange {}

impl crate::BufferMappedRangeSlice for BufferMappedRange {
fn slice(&self) -> &[u8] {
unsafe { slice::from_raw_parts(self.ptr, self.size) }
Expand Down

0 comments on commit f525302

Please sign in to comment.