Use repr(C) for Id

This commit is contained in:
Joshua Groves 2019-03-07 19:04:01 -07:00
parent a55502c1e2
commit e921b59298
2 changed files with 10 additions and 1 deletions

View File

@ -240,7 +240,14 @@ typedef enum {
typedef struct WGPUBufferMapAsyncStatus WGPUBufferMapAsyncStatus;
typedef struct WGPUId WGPUId;
typedef uint32_t WGPUIndex;
typedef uint32_t WGPUEpoch;
typedef struct {
WGPUIndex _0;
WGPUEpoch _1;
} WGPUId;
typedef WGPUId WGPUDeviceId;

View File

@ -18,6 +18,8 @@ use std::sync::Arc;
pub(crate) type Index = u32;
pub(crate) type Epoch = u32;
#[repr(C)]
#[derive(Clone, Copy, Debug, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Id(Index, Epoch);