2022-11-11 17:44:41 +11:00
|
|
|
use crate::error::ShaderReflectError;
|
2022-10-28 11:39:39 +11:00
|
|
|
use crate::reflect::semantics::{
|
2022-11-24 17:37:16 +11:00
|
|
|
SemanticMap, TextureBinding, TextureSemantics, TextureSizeMeta, VariableMeta, VariableSemantics,
|
2022-10-28 11:39:39 +11:00
|
|
|
};
|
2022-10-26 13:13:39 +11:00
|
|
|
use rustc_hash::FxHashMap;
|
2022-11-22 08:53:36 +11:00
|
|
|
use semantics::ReflectSemantics;
|
2022-10-24 14:22:26 +11:00
|
|
|
|
2022-11-07 16:25:11 +11:00
|
|
|
pub mod cross;
|
2022-11-22 08:21:50 +11:00
|
|
|
|
|
|
|
pub mod semantics;
|
|
|
|
|
|
|
|
#[cfg(feature = "unstable-rust-pipeline")]
|
2022-10-23 17:36:41 +11:00
|
|
|
mod naga;
|
2022-11-22 08:21:50 +11:00
|
|
|
#[cfg(feature = "unstable-rust-pipeline")]
|
2022-10-26 13:13:39 +11:00
|
|
|
mod rspirv;
|
2022-10-24 14:22:26 +11:00
|
|
|
|
|
|
|
pub trait ReflectShader {
|
2022-11-11 17:44:41 +11:00
|
|
|
fn reflect(
|
|
|
|
&mut self,
|
2022-11-20 10:48:54 +11:00
|
|
|
pass_number: usize,
|
2022-11-11 17:44:41 +11:00
|
|
|
semantics: &ReflectSemantics,
|
|
|
|
) -> Result<ShaderReflection, ShaderReflectError>;
|
2022-10-24 14:22:26 +11:00
|
|
|
}
|
2022-10-26 13:13:39 +11:00
|
|
|
|
2022-10-26 16:19:04 +11:00
|
|
|
#[derive(Debug, Default)]
|
|
|
|
pub struct ReflectMeta {
|
2022-11-13 18:05:49 +11:00
|
|
|
pub parameter_meta: FxHashMap<String, VariableMeta>,
|
2022-10-26 16:19:04 +11:00
|
|
|
pub variable_meta: FxHashMap<VariableSemantics, VariableMeta>,
|
2022-11-24 17:37:16 +11:00
|
|
|
pub texture_meta: FxHashMap<SemanticMap<TextureSemantics>, TextureBinding>,
|
2022-10-27 17:22:44 +11:00
|
|
|
pub texture_size_meta: FxHashMap<SemanticMap<TextureSemantics>, TextureSizeMeta>,
|
2022-10-26 13:13:39 +11:00
|
|
|
}
|
|
|
|
|
2022-11-11 17:44:41 +11:00
|
|
|
pub use semantics::ShaderReflection;
|