Rename serde feature

This commit is contained in:
Joshua Groves 2020-03-10 23:19:45 -02:30
parent 9940aef599
commit 24caf76765
6 changed files with 20 additions and 15 deletions

View File

@ -17,7 +17,7 @@ license = "MPL-2.0"
[features]
default = []
metal-auto-capture = ["gfx-backend-metal/auto-capture"]
serde1 = ["wgt/serde"]
serde = ["wgt/serde", "serde_crate"]
#NOTE: glutin feature is not stable, use at your own risk
#glutin = ["gfx-backend-gl/glutin"]
@ -33,10 +33,15 @@ parking_lot = "0.9"
peek-poke = { git = "https://github.com/kvark/peek-poke", rev = "969bd7fe2be1a83f87916dc8b388c63cfd457075" }
rendy-memory = "0.5"
rendy-descriptor = "0.5"
serde = { version = "1.0", features = ["serde_derive"], optional = true }
smallvec = "1.0"
vec_map = "0.8"
[dependencies.serde_crate]
package = "serde"
version = "1.0"
features = ["serde_derive"]
optional = true
[dependencies.wgt]
path = "../wgpu-types"
package = "wgpu-types"

View File

@ -16,12 +16,12 @@ use arrayvec::ArrayVec;
use rendy_descriptor::{DescriptorRanges, DescriptorSet};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use serde_crate::{Deserialize, Serialize};
use std::borrow::Borrow;
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub enum BindingType {
UniformBuffer = 0,
StorageBuffer = 1,
@ -33,7 +33,7 @@ pub enum BindingType {
#[repr(C)]
#[derive(Clone, Debug, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub struct BindGroupLayoutBinding {
pub binding: u32,
pub visibility: wgt::ShaderStage,
@ -73,7 +73,7 @@ pub struct PipelineLayout<B: hal::Backend> {
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub struct BufferBinding {
pub buffer: BufferId,
pub offset: BufferAddress,
@ -82,7 +82,7 @@ pub struct BufferBinding {
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub enum BindingResource {
Buffer(BufferBinding),
Sampler(SamplerId),
@ -91,7 +91,7 @@ pub enum BindingResource {
#[repr(C)]
#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub struct BindGroupBinding {
pub binding: u32,
pub resource: BindingResource,

View File

@ -4,7 +4,7 @@
use crate::{Epoch, Index};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use serde_crate::{Deserialize, Serialize};
use wgt::Backend;
use std::{fmt, marker::PhantomData, mem};
@ -13,7 +13,7 @@ const EPOCH_MASK: u32 = (1 << (32 - BACKEND_BITS)) - 1;
type Dummy = crate::backend::Empty;
#[repr(transparent)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub struct Id<T>(u64, PhantomData<T>);
impl<T> Id<T> {

View File

@ -13,7 +13,7 @@ use crate::{
use wgt::{Backend, BackendBit, DeviceDescriptor, PowerPreference, RequestAdapterOptions};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use serde_crate::{Deserialize, Serialize};
use hal::{
self,
@ -103,7 +103,7 @@ pub struct Adapter<B: hal::Backend> {
/// Metadata about a backend adapter.
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub struct AdapterInfo {
/// Adapter name
pub name: String,
@ -138,7 +138,7 @@ impl AdapterInfo {
/// Supported physical device types
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize), serde(crate="serde_crate"))]
pub enum DeviceType {
/// Other
Other,

View File

@ -15,7 +15,7 @@ use wgt::{BufferAddress, BufferUsage, CompareFunction, TextureFormat};
use hal;
use rendy_memory::MemoryBlock;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use serde_crate::{Deserialize, Serialize};
use std::{borrow::Borrow, fmt};

View File

@ -19,7 +19,7 @@ default = []
path = "../wgpu-core"
package = "wgpu-core"
version = "0.1"
features = ["serde1"]
features = ["serde"]
[dependencies.wgt]
path = "../wgpu-types"