Enum wgpu_types::BufferBindingType
source · pub enum BufferBindingType {
Uniform,
Storage {
read_only: bool,
},
}
Expand description
Specific type of a buffer binding.
Corresponds to WebGPU GPUBufferBindingType
.
Variants§
Uniform
A buffer for uniform values.
Example WGSL syntax:
ⓘ
struct Globals {
a_uniform: vec2<f32>,
another_uniform: vec2<f32>,
}
@group(0) @binding(0)
var<uniform> globals: Globals;
Example GLSL syntax:
layout(std140, binding = 0)
uniform Globals {
vec2 aUniform;
vec2 anotherUniform;
};
Storage
A storage buffer.
Example WGSL syntax:
ⓘ
@group(0) @binding(0)
var<storage, read_write> my_element: array<vec4<f32>>;
Example GLSL syntax:
layout (set=0, binding=0) buffer myStorageBuffer {
vec4 myElement[];
};
Fields
§
read_only: bool
If true
, the buffer can only be read in the shader,
and it:
- may or may not be annotated with
read
(WGSL). - must be annotated with
readonly
(GLSL).
Example WGSL syntax:
ⓘ
@group(0) @binding(0)
var<storage, read> my_element: array<vec4<f32>>;
Example GLSL syntax:
layout (set=0, binding=0) readonly buffer myStorageBuffer {
vec4 myElement[];
};
Trait Implementations§
source§impl Clone for BufferBindingType
impl Clone for BufferBindingType
source§fn clone(&self) -> BufferBindingType
fn clone(&self) -> BufferBindingType
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BufferBindingType
impl Debug for BufferBindingType
source§impl Default for BufferBindingType
impl Default for BufferBindingType
source§fn default() -> BufferBindingType
fn default() -> BufferBindingType
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for BufferBindingType
impl<'de> Deserialize<'de> for BufferBindingType
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>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for BufferBindingType
impl Hash for BufferBindingType
source§impl PartialEq for BufferBindingType
impl PartialEq for BufferBindingType
source§fn eq(&self, other: &BufferBindingType) -> bool
fn eq(&self, other: &BufferBindingType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BufferBindingType
impl Serialize for BufferBindingType
impl Copy for BufferBindingType
impl Eq for BufferBindingType
impl StructuralPartialEq for BufferBindingType
Auto Trait Implementations§
impl Freeze for BufferBindingType
impl RefUnwindSafe for BufferBindingType
impl Send for BufferBindingType
impl Sync for BufferBindingType
impl Unpin for BufferBindingType
impl UnwindSafe for BufferBindingType
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
Mutably borrows from an owned value. Read more