From 446fdad33e4e23efa7a6f973d0aaef7aed118ba9 Mon Sep 17 00:00:00 2001 From: Joshua Groves Date: Mon, 3 Dec 2018 21:21:19 -0700 Subject: [PATCH] Add `repr(transparent)` to buffer usage flags --- wgpu-bindings/wgpu.h | 18 ++++++++++++++++++ wgpu-native/src/resource.rs | 1 + 2 files changed, 19 insertions(+) diff --git a/wgpu-bindings/wgpu.h b/wgpu-bindings/wgpu.h index d7a398acf..6299c9c08 100644 --- a/wgpu-bindings/wgpu.h +++ b/wgpu-bindings/wgpu.h @@ -269,6 +269,24 @@ typedef struct { uint32_t array_count; } WGPUTextureViewDescriptor; +#define WGPUBufferUsageFlags_INDEX 16 + +#define WGPUBufferUsageFlags_MAP_READ 1 + +#define WGPUBufferUsageFlags_MAP_WRITE 2 + +#define WGPUBufferUsageFlags_NONE 0 + +#define WGPUBufferUsageFlags_STORAGE 128 + +#define WGPUBufferUsageFlags_TRANSFER_DST 8 + +#define WGPUBufferUsageFlags_TRANSFER_SRC 4 + +#define WGPUBufferUsageFlags_UNIFORM 64 + +#define WGPUBufferUsageFlags_VERTEX 32 + #define WGPUColorWriteFlags_ALL 15 #define WGPUColorWriteFlags_ALPHA 8 diff --git a/wgpu-native/src/resource.rs b/wgpu-native/src/resource.rs index 9ed757b16..bfe0903e6 100644 --- a/wgpu-native/src/resource.rs +++ b/wgpu-native/src/resource.rs @@ -7,6 +7,7 @@ use hal; bitflags! { + #[repr(transparent)] pub struct BufferUsageFlags: u32 { const MAP_READ = 1; const MAP_WRITE = 2;