451: Make BindGroupLayoutBinding Serializable r=kvark a=imiklos

cc @kvark @zakorgy

Co-authored-by: Istvan Miklos <istvan.miklos@h-lab.eu>
This commit is contained in:
bors[bot] 2020-01-14 20:04:21 +00:00 committed by GitHub
commit 881222a947
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -16,12 +16,15 @@ use crate::{
use arrayvec::ArrayVec;
use rendy_descriptor::{DescriptorRanges, DescriptorSet};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::borrow::Borrow;
pub const MAX_BIND_GROUPS: usize = 4;
bitflags::bitflags! {
#[repr(transparent)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct ShaderStage: u32 {
const NONE = 0;
const VERTEX = 1;
@ -32,6 +35,7 @@ bitflags::bitflags! {
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum BindingType {
UniformBuffer = 0,
StorageBuffer = 1,
@ -43,6 +47,7 @@ pub enum BindingType {
#[repr(C)]
#[derive(Clone, Debug, Hash, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct BindGroupLayoutBinding {
pub binding: u32,
pub visibility: ShaderStage,

View File

@ -276,6 +276,7 @@ impl Default for TextureAspect {
#[repr(C)]
#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub enum TextureViewDimension {
D1,
D2,