Make BindGroupLayoutBinding Serializable

This commit is contained in:
Istvan Miklos 2020-01-14 11:42:03 +01:00
parent c0fa61a064
commit 0fdf77feb5
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,