#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum BindType {
Buffer,
BufReadOnly,
Uniform,
Image,
ImageRead,
}
impl BindType {
pub fn is_mutable(self) -> bool {
matches!(self, Self::Buffer | Self::Image)
}
}
#[derive(Clone, Debug)]
pub struct BindingInfo {
pub name: Option<String>,
pub location: (u32, u32),
pub ty: BindType,
}
#[derive(Clone, Debug)]
pub struct WorkgroupBufferInfo {
pub size_in_bytes: u32,
pub index: u32,
}
#[cfg(feature = "msl")]
pub mod msl {
use std::fmt;
#[derive(Clone)]
pub enum BindingIndex {
Buffer(u8),
Texture(u8),
}
impl fmt::Debug for BindingIndex {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Self::Buffer(i) => write!(f, "msl::BindingIndex::Buffer({i})"),
Self::Texture(i) => write!(f, "msl::BindingIndex::Texture({i})"),
}
}
}
}