librashader/librashader-reflect/src/reflect/mod.rs

34 lines
947 B
Rust
Raw Normal View History

use crate::error::ShaderReflectError;
2022-10-28 11:39:39 +11:00
use crate::reflect::semantics::{
SemanticMap, TextureBinding, TextureSemantics, TextureSizeMeta, VariableMeta, VariableSemantics,
2022-10-28 11:39:39 +11:00
};
use rustc_hash::FxHashMap;
2022-11-22 08:53:36 +11:00
use semantics::ReflectSemantics;
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")]
mod rspirv;
pub trait ReflectShader {
fn reflect(
&mut self,
2022-11-20 10:48:54 +11:00
pass_number: usize,
semantics: &ReflectSemantics,
) -> Result<ShaderReflection, ShaderReflectError>;
}
#[derive(Debug, Default)]
pub struct ReflectMeta {
pub parameter_meta: FxHashMap<String, VariableMeta>,
pub variable_meta: FxHashMap<VariableSemantics, VariableMeta>,
pub texture_meta: FxHashMap<SemanticMap<TextureSemantics>, TextureBinding>,
2022-10-27 17:22:44 +11:00
pub texture_size_meta: FxHashMap<SemanticMap<TextureSemantics>, TextureSizeMeta>,
}
pub use semantics::ShaderReflection;