From dc2d581c8d029e44793d14375210952c26d1f974 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Tue, 6 Oct 2020 13:36:17 -0400 Subject: [PATCH] Add repr(C) on mapping structs --- wgpu-core/src/device/mod.rs | 1 + wgpu-core/src/resource.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 4054a37d8..fd4439290 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -70,6 +70,7 @@ pub fn all_image_stages() -> hal::pso::PipelineStage { | Ps::TRANSFER } +#[repr(C)] #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "trace", derive(serde::Serialize))] #[cfg_attr(feature = "replay", derive(serde::Deserialize))] diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 78d99bffe..f88fa2211 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -104,6 +104,7 @@ unsafe impl Sync for BufferMapState {} pub type BufferMapCallback = unsafe extern "C" fn(status: BufferMapAsyncStatus, userdata: *mut u8); +#[repr(C)] #[derive(Debug)] pub struct BufferMapOperation { pub host: crate::device::HostMap,