pub struct PipelineCacheKey {
pub version: u32,
pub shader_hash: [u8; 32],
pub bind_group_layout_hash: [u8; 32],
pub push_constant_size: u32,
pub workgroup_size: [u32; 3],
pub feature_flags: PipelineFeatureFlags,
pub backend_id: BackendId,
/* private fields */
}Expand description
Versioned pipeline-cache key shared by every backend.
Replaces the pre-0.6 pattern of using a raw blake3 hash as the key. A raw hash is not robust: two pipelines that should miss (different bind-group layout, different push-constant size, different workgroup-size selection) hashed identically because the hash covered the shader source only. Silent cache hits against a non-equivalent pipeline are a correctness hazard (wrong bind-group layout binds undefined data; wrong workgroup-size launches beyond guarantees).
#[non_exhaustive] is enforced at the type level via the private
__phantom field: external callers construct keys through
PipelineCacheKey::new and cannot match exhaustively, so additive
key fields do not break downstream matches.
Fields§
§version: u32Key format version. Bumped to invalidate every cache entry without an API break.
shader_hash: [u8; 32]blake3 hash of the canonical backend pipeline-source bytes.
bind_group_layout_hash: [u8; 32]Structural hash of the bind-group layout descriptors. Not the backend handle; the bytes that describe slot count, types, visibility, and access modes per bind group.
push_constant_size: u32Push-constant range in bytes. Included so a pipeline compiled for 16 B push constants never reuses against a layout that expects 32 B.
workgroup_size: [u32; 3]Workgroup-size [x, y, z] the pipeline was specialized for.
feature_flags: PipelineFeatureFlagsFeature-flag bits the pipeline assumes at dispatch time.
backend_id: BackendIdBackend identity. Prevents pipelines from different backends from colliding when they happen to produce identical shader hashes.
Implementations§
Trait Implementations§
Source§impl Clone for PipelineCacheKey
impl Clone for PipelineCacheKey
Source§fn clone(&self) -> PipelineCacheKey
fn clone(&self) -> PipelineCacheKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PipelineCacheKey
impl Debug for PipelineCacheKey
impl Eq for PipelineCacheKey
Source§impl Hash for PipelineCacheKey
impl Hash for PipelineCacheKey
Source§impl PartialEq for PipelineCacheKey
impl PartialEq for PipelineCacheKey
Source§fn eq(&self, other: &PipelineCacheKey) -> bool
fn eq(&self, other: &PipelineCacheKey) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PipelineCacheKey
Auto Trait Implementations§
impl Freeze for PipelineCacheKey
impl RefUnwindSafe for PipelineCacheKey
impl Send for PipelineCacheKey
impl Sync for PipelineCacheKey
impl Unpin for PipelineCacheKey
impl UnsafeUnpin for PipelineCacheKey
impl UnwindSafe for PipelineCacheKey
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.