use super::*;
#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash)]
pub struct ShaderId(id::Id);
#[derive(Clone, Debug)]
pub enum ShaderError {
CompilationError { kind: ShaderKind, message: String },
LinkError(String),
Internal(String),
}
impl ShaderId {
pub fn next() -> Self {
Self(id::next())
}
}
#[derive(Clone, Debug, Copy, PartialEq, Eq)]
pub enum ShaderKind {
Vertex,
Fragment,
}
#[derive(Debug)]
pub struct ShaderSource<'a> {
pub vertex: &'a str,
pub fragment: &'a str,
}
#[derive(Debug, Clone)]
pub struct ShaderDescriptor {
pub uniforms: UniformBlockLayout,
pub textures: Vec<String>,
}
#[derive(Clone, Debug)]
pub struct Bindings {
pub vertex: Vec<BufferId>,
pub index: Option<BufferId>,
pub textures: Vec<TextureId>,
}