preprocess: allow shadersource to be serializable with serde
This commit is contained in:
parent
1676150858
commit
5ede061975
|
@ -16,10 +16,12 @@ thiserror = "1.0.37"
|
|||
nom = "7.1.1"
|
||||
librashader-common = { path = "../librashader-common", version = "0.4.5" }
|
||||
encoding_rs = "0.8.31"
|
||||
serde = { version = "1.0", optional = true }
|
||||
|
||||
[features]
|
||||
default = [ "line_directives" ]
|
||||
line_directives = []
|
||||
serde = ["dep:serde", "serde/derive", "librashader-common/serde"]
|
||||
|
||||
[dev-dependencies]
|
||||
glob = "0.3.1"
|
||||
|
|
|
@ -21,6 +21,7 @@ use std::path::Path;
|
|||
|
||||
/// The source file for a single shader pass.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct ShaderSource {
|
||||
/// The source contents for the vertex shader.
|
||||
pub vertex: String,
|
||||
|
@ -40,6 +41,7 @@ pub struct ShaderSource {
|
|||
|
||||
/// A user tweakable parameter for the shader as declared in source.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
pub struct ShaderParameter {
|
||||
/// The name of the parameter.
|
||||
pub id: ShortString,
|
||||
|
|
Loading…
Reference in a new issue