use crate::*;
#[derive(Debug, Clone)]
pub struct BindGroupLayout {
pub(crate) inner: dispatch::DispatchBindGroupLayout,
}
#[cfg(send_sync)]
static_assertions::assert_impl_all!(BindGroupLayout: Send, Sync);
crate::cmp::impl_eq_ord_hash_proxy!(BindGroupLayout => .inner);
impl BindGroupLayout {
#[cfg(custom)]
pub fn as_custom<T: custom::BindGroupLayoutInterface>(&self) -> Option<&T> {
self.inner.as_custom()
}
}
#[cfg(wgpu_core)]
impl BindGroupLayout {
pub fn from_core(
core_bind_group_layout: alloc::sync::Arc<wgc::binding_model::BindGroupLayout>,
) -> Self {
Self {
inner: crate::backend::wgpu_core::CoreBindGroupLayout::from_core(
core_bind_group_layout,
)
.into(),
}
}
pub fn as_core(&self) -> Option<alloc::sync::Arc<wgc::binding_model::BindGroupLayout>> {
self.inner.as_core_opt().map(|bgl| bgl.as_core())
}
}
#[derive(Clone, Debug)]
pub struct BindGroupLayoutDescriptor<'a> {
pub label: Label<'a>,
pub entries: &'a [BindGroupLayoutEntry],
}
static_assertions::assert_impl_all!(BindGroupLayoutDescriptor<'_>: Send, Sync);