//! Embedded WGSL shader sources used by the host pipeline.

/// Xenos uber-shader scaffold (P3). See the comment at the top of
/// [`XENOS_INTERP_WGSL`] for scope/limits and the plan's P3b target state.
pub const XENOS_INTERP_WGSL: &str = include_str!("xenos_interp.wgsl");

#[cfg(test)]
mod tests {
    use super::*;

    /// Parsing through naga validates the shader against WGSL spec + wgpu's
    /// type system. We don't need a full pipeline to catch typos and layout
    /// mistakes — this test is fast and catches regressions at `cargo test`
    /// time.
    #[test]
    fn xenos_interp_wgsl_parses() {
        let module = naga::front::wgsl::parse_str(XENOS_INTERP_WGSL)
            .expect("xenos_interp.wgsl must parse cleanly");
        // Sanity: we declared two entry points.
        assert!(!module.entry_points.is_empty());
        assert!(
            module
                .entry_points
                .iter()
                .any(|e| e.name == "vs_main" && e.stage == naga::ShaderStage::Vertex),
            "missing vs_main entry"
        );
        assert!(
            module
                .entry_points
                .iter()
                .any(|e| e.name == "fs_main" && e.stage == naga::ShaderStage::Fragment),
            "missing fs_main entry"
        );
    }
}
