#[repr(u8)]pub enum LoadOp<V> {
Clear(V),
Load = 1,
DontCare(LoadOpDontCare),
}Expand description
Operation to perform to the output attachment at the start of a render pass.
Corresponds to WebGPU GPULoadOp,
plus the corresponding clearValue.
Variants§
Clear(V)
Loads the specified value for this attachment into the render pass.
On some GPU hardware (primarily mobile), “clear” is significantly cheaper because it avoids loading data from main memory into tile-local memory.
On other GPU hardware, there isn’t a significant difference.
As a result, it is recommended to use “clear” rather than “load” in cases where the initial value doesn’t matter (e.g. the render target will be cleared using a skybox).
Load = 1
Loads the existing value for this attachment into the render pass.
DontCare(LoadOpDontCare)
The render target has undefined contents at the start of the render pass. This may lead to undefined behavior if you read from the any of the render target pixels without first writing to them.
Blending also becomes undefined behavior if the source pixels are undefined.
This is the fastest option on all GPUs if you always overwrite all pixels in the render target after this load operation.
Backends that don’t support DontCare internally, will pick a different (unspecified)
load op instead.
§Safety
- All pixels in the render target must be written to before
any read or a
StoreOp::Storeoccurs.
Implementations§
Trait Implementations§
Source§impl<'de, V> Deserialize<'de> for LoadOp<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for LoadOp<V>where
V: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadOp<V>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LoadOp<V>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<V> Serialize for LoadOp<V>where
V: Serialize,
impl<V> Serialize for LoadOp<V>where
V: Serialize,
Source§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,
impl<V> Copy for LoadOp<V>where
V: Copy,
impl<V> Eq for LoadOp<V>where
V: Eq,
impl<V> StructuralPartialEq for LoadOp<V>
Auto Trait Implementations§
impl<V> Freeze for LoadOp<V>where
V: Freeze,
impl<V> RefUnwindSafe for LoadOp<V>where
V: RefUnwindSafe,
impl<V> Send for LoadOp<V>where
V: Send,
impl<V> Sync for LoadOp<V>where
V: Sync,
impl<V> Unpin for LoadOp<V>where
V: Unpin,
impl<V> UnwindSafe for LoadOp<V>where
V: UnwindSafe,
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<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
§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
key and return true if they are equal.