Enum wgpu::BufferBindingType
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
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[];
};
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[];
};
Trait Implementations§
§impl Clone for BufferBindingType
impl Clone for BufferBindingType
§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 more§impl Debug for BufferBindingType
impl Debug for BufferBindingType
§impl Default for BufferBindingType
impl Default for BufferBindingType
§fn default() -> BufferBindingType
fn default() -> BufferBindingType
Returns the “default value” for a type. Read more
§impl<'de> Deserialize<'de> for BufferBindingType
impl<'de> Deserialize<'de> for BufferBindingType
§fn deserialize<__D>(
__deserializer: __D
) -> Result<BufferBindingType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<BufferBindingType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Hash for BufferBindingType
impl Hash for BufferBindingType
§impl PartialEq for BufferBindingType
impl PartialEq for BufferBindingType
§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 ==
.§impl Serialize for BufferBindingType
impl Serialize for BufferBindingType
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for BufferBindingType
impl Eq for BufferBindingType
impl StructuralEq for BufferBindingType
impl StructuralPartialEq for BufferBindingType
Auto Trait Implementations§
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more