pub enum MemoryClass {
Global,
Shared,
Constant,
Uniform,
Scratch,
}Expand description
Where a binding’s storage lives.
Variants§
Global
Global / device memory; visible to every workgroup.
Workgroup-shared memory.
Constant
Read-only constant memory backed by a storage buffer
(BufferDecl::storage(.., ReadOnly, ..)). Bind in group 0
alongside Global writers.
Uniform
True uniform-buffer memory backed by BufferDecl::uniform.
Maps to WGSL var<uniform> / Vulkan uniform_buffer descriptor
and binds in group 1 per bind_group_for. Distinct from
Constant so the emitter can pick AddressSpace::Uniform and
the layout builder can reserve the second bind group.
Scratch
Backend-managed scratch storage.
Implementations§
Source§impl MemoryClass
impl MemoryClass
Sourcepub fn is_global_visibility(self) -> bool
pub fn is_global_visibility(self) -> bool
True iff this memory class is visible across workgroups (Global, Constant). Shared and Scratch are workgroup-local.
Sourcepub fn is_writable(self) -> bool
pub fn is_writable(self) -> bool
True iff this memory class can be written by the kernel. Constant is read-only; the rest are writable.
Trait Implementations§
Source§impl Clone for MemoryClass
impl Clone for MemoryClass
Source§fn clone(&self) -> MemoryClass
fn clone(&self) -> MemoryClass
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MemoryClass
Source§impl Debug for MemoryClass
impl Debug for MemoryClass
Source§impl<'de> Deserialize<'de> for MemoryClass
impl<'de> Deserialize<'de> for MemoryClass
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for MemoryClass
Source§impl Hash for MemoryClass
impl Hash for MemoryClass
Source§impl PartialEq for MemoryClass
impl PartialEq for MemoryClass
Source§impl Serialize for MemoryClass
impl Serialize for MemoryClass
impl StructuralPartialEq for MemoryClass
Auto Trait Implementations§
impl Freeze for MemoryClass
impl RefUnwindSafe for MemoryClass
impl Send for MemoryClass
impl Sync for MemoryClass
impl Unpin for MemoryClass
impl UnsafeUnpin for MemoryClass
impl UnwindSafe for MemoryClass
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.