Struct wgpu_core::pipeline_cache::PipelineCacheHeader

source ·
#[repr(C)]
struct PipelineCacheHeader { magic: [u8; 8], header_version: u32, cache_abi: u32, backend: u8, adapter_key: [u8; 15], validation_key: [u8; 16], data_size: u64, hash_space: u64, }

Fields§

§magic: [u8; 8]

The magic header to ensure that we have the right file format Has a value of MAGIC, as above

§header_version: u32

The version of this wgpu header Should be equal to HEADER_VERSION above

This must always be the second item, after the value above

§cache_abi: u32

The number of bytes in the pointers of this ABI, because some drivers have previously not distinguished between their 32 bit and 64 bit drivers leading to Vulkan data corruption

§backend: u8

The id for the backend in use, from wgt::Backend

§adapter_key: [u8; 15]

The key which identifiers the device/adapter. This is used to validate that this pipeline cache (probably) was produced for the expected device. On Vulkan: it is a combination of vendor ID and device ID

§validation_key: [u8; 16]

A key used to validate that this device is still compatible with the cache

This should e.g. contain driver version and/or intermediate compiler versions

§data_size: u64

The length of the data which is sent to/recieved from the backend

§hash_space: u64

Space reserved for a hash of the data in future

We assume that your cache storage system will be relatively robust, and so do not validate this hash

Therefore, this will always have a value of HASH_SPACE_VALUE

Implementations§

source§

impl PipelineCacheHeader

source

fn read(data: &[u8]) -> Option<(PipelineCacheHeader, &[u8])>

source

fn write(&self, into: &mut [u8]) -> Option<()>

Trait Implementations§

source§

impl PartialEq for PipelineCacheHeader

source§

fn eq(&self, other: &PipelineCacheHeader) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for PipelineCacheHeader

source§

impl StructuralPartialEq for PipelineCacheHeader

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSendSync for T

source§

impl<T> WasmNotSync for T
where T: Sync,