mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Use repr(C) for Id
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user