@@ -123,7 +123,7 @@ pub enum SpirvBuilderError {
123
123
124
124
const SPIRV_TARGET_PREFIX : & str = "spirv-unknown-" ;
125
125
126
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default ) ]
126
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default , serde :: Deserialize , serde :: Serialize ) ]
127
127
pub enum MetadataPrintout {
128
128
/// Print no cargo metadata.
129
129
None ,
@@ -136,7 +136,7 @@ pub enum MetadataPrintout {
136
136
Full ,
137
137
}
138
138
139
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default ) ]
139
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default , serde :: Deserialize , serde :: Serialize ) ]
140
140
pub enum SpirvMetadata {
141
141
/// Strip all names and other debug information from SPIR-V output.
142
142
#[ default]
@@ -149,7 +149,7 @@ pub enum SpirvMetadata {
149
149
}
150
150
151
151
/// Strategy used to handle Rust `panic!`s in shaders compiled to SPIR-V.
152
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default ) ]
152
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Default , serde :: Deserialize , serde :: Serialize ) ]
153
153
pub enum ShaderPanicStrategy {
154
154
/// Return from shader entry-point with no side-effects **(default)**.
155
155
///
@@ -232,7 +232,7 @@ pub enum ShaderPanicStrategy {
232
232
233
233
/// Options for specifying the behavior of the validator
234
234
/// Copied from `spirv-tools/src/val.rs` struct `ValidatorOptions`, with some fields disabled.
235
- #[ derive( Default , Clone ) ]
235
+ #[ derive( Default , Clone , serde :: Deserialize , serde :: Serialize ) ]
236
236
pub struct ValidatorOptions {
237
237
/// Record whether or not the validator should relax the rules on types for
238
238
/// stores to structs. When relaxed, it will allow a type mismatch as long as
@@ -301,7 +301,7 @@ pub struct ValidatorOptions {
301
301
302
302
/// Options for specifying the behavior of the optimizer
303
303
/// Copied from `spirv-tools/src/opt.rs` struct `Options`, with some fields disabled.
304
- #[ derive( Default , Clone ) ]
304
+ #[ derive( Default , Clone , serde :: Deserialize , serde :: Serialize ) ]
305
305
pub struct OptimizerOptions {
306
306
// /// Records the validator options that should be passed to the validator,
307
307
// /// the validator will run with the options before optimizer.
@@ -316,7 +316,7 @@ pub struct OptimizerOptions {
316
316
}
317
317
318
318
/// Cargo features specification for building the shader crate.
319
- #[ derive( Default ) ]
319
+ #[ derive( Default , Clone , serde :: Deserialize , serde :: Serialize ) ]
320
320
pub struct ShaderCrateFeatures {
321
321
/// Set --default-features for the target shader crate.
322
322
pub default_features : Option < bool > ,
@@ -325,6 +325,7 @@ pub struct ShaderCrateFeatures {
325
325
}
326
326
327
327
#[ non_exhaustive]
328
+ #[ derive( Clone , serde:: Deserialize , serde:: Serialize ) ]
328
329
pub struct SpirvBuilder {
329
330
pub path_to_crate : Option < PathBuf > ,
330
331
/// Whether to print build.rs cargo metadata (e.g. cargo:rustc-env=var=val). Defaults to [`MetadataPrintout::Full`].
0 commit comments