From 45be9035b71f653b4ac62b2d6842ce3d564d6901 Mon Sep 17 00:00:00 2001 From: Istvan Miklos Date: Wed, 11 Dec 2019 14:43:05 +0100 Subject: [PATCH] Add Serialize/Deserialize derive to `BufferDescriptor` --- wgpu-core/src/resource.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index 16475ea749..7700e36ba6 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -15,11 +15,14 @@ use crate::{ use hal; use rendy_memory::MemoryBlock; use smallvec::SmallVec; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; use std::{borrow::Borrow, fmt}; bitflags::bitflags! { #[repr(transparent)] + #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct BufferUsage: u32 { const MAP_READ = 1; const MAP_WRITE = 2; @@ -46,6 +49,7 @@ bitflags::bitflags! { } #[repr(C)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[derive(Clone, Debug)] pub struct BufferDescriptor { pub size: BufferAddress,