render: fix bind group PartialEq impl
This commit is contained in:
parent
c38420f1e9
commit
dfbdeeb27f
@ -4,7 +4,7 @@ use std::{
|
|||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
#[derive(Clone, Debug, Eq)]
|
||||||
pub struct BindGroupDescriptor {
|
pub struct BindGroupDescriptor {
|
||||||
pub index: u32,
|
pub index: u32,
|
||||||
pub bindings: Vec<BindingDescriptor>,
|
pub bindings: Vec<BindingDescriptor>,
|
||||||
@ -35,9 +35,17 @@ impl BindGroupDescriptor {
|
|||||||
|
|
||||||
impl Hash for BindGroupDescriptor {
|
impl Hash for BindGroupDescriptor {
|
||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
// TODO: remove index from hash state (or at least id). index is not considered a part of a bind group on the gpu.
|
// TODO: remove index from hash state (or at least id), and update the PartialEq implem.
|
||||||
// bind groups are bound to indices in pipelines
|
// index is not considered a part of a bind group on the gpu.
|
||||||
|
// bind groups are bound to indices in pipelines.
|
||||||
self.index.hash(state);
|
self.index.hash(state);
|
||||||
self.bindings.hash(state);
|
self.bindings.hash(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq for BindGroupDescriptor {
|
||||||
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
// This MUST be kept in sync with the hash implementation above
|
||||||
|
self.index == other.index && self.bindings == other.bindings
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user