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§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)