librashader/librashader-reflect/src/reflect/helper.rs
chyyran aea440f194 reflect: remove rspirv
When naga is more mature (i.e. with support for COMBINED_IMAGE_SAMPLER), `naga::Module` handles everything we need with a more ergonomic API
2023-01-15 20:06:36 -05:00

33 lines
747 B
Rust

use crate::error::{SemanticsErrorKind, ShaderReflectError};
pub struct UboData {
// id: u32,
// descriptor_set: u32,
pub binding: u32,
pub size: u32,
}
pub struct TextureData<'a> {
// id: u32,
// descriptor_set: u32,
pub name: &'a str,
pub binding: u32,
}
// todo: might want to take these crate helpers out.
#[derive(Copy, Clone)]
pub enum SemanticErrorBlame {
Vertex,
Fragment,
}
impl SemanticErrorBlame {
pub fn error(self, kind: SemanticsErrorKind) -> ShaderReflectError {
match self {
SemanticErrorBlame::Vertex => ShaderReflectError::VertexSemanticError(kind),
SemanticErrorBlame::Fragment => ShaderReflectError::FragmentSemanticError(kind),
}
}
}