mirror of
https://github.com/bevyengine/bevy
synced 2025-02-16 14:08:32 +00:00
render: fix RenderResourceBinding PartialEq impl
This commit is contained in:
parent
dfbdeeb27f
commit
e36b26c226
1 changed files with 29 additions and 1 deletions
|
@ -11,7 +11,7 @@ use std::{
|
|||
};
|
||||
use uuid::Uuid;
|
||||
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
#[derive(Clone, Eq, Debug)]
|
||||
pub enum RenderResourceBinding {
|
||||
Buffer {
|
||||
buffer: BufferId,
|
||||
|
@ -48,6 +48,34 @@ impl RenderResourceBinding {
|
|||
}
|
||||
}
|
||||
|
||||
impl PartialEq for RenderResourceBinding {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
match (self, other) {
|
||||
(
|
||||
RenderResourceBinding::Buffer {
|
||||
buffer: self_buffer,
|
||||
range: self_range,
|
||||
dynamic_index: _,
|
||||
},
|
||||
RenderResourceBinding::Buffer {
|
||||
buffer: other_buffer,
|
||||
range: other_range,
|
||||
dynamic_index: _,
|
||||
},
|
||||
) => self_buffer == other_buffer && self_range == other_range,
|
||||
(
|
||||
RenderResourceBinding::Texture(self_texture),
|
||||
RenderResourceBinding::Texture(other_texture),
|
||||
) => RenderResourceId::from(*self_texture) == RenderResourceId::from(*other_texture),
|
||||
(
|
||||
RenderResourceBinding::Sampler(self_sampler),
|
||||
RenderResourceBinding::Sampler(other_sampler),
|
||||
) => RenderResourceId::from(*self_sampler) == RenderResourceId::from(*other_sampler),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Hash for RenderResourceBinding {
|
||||
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Reference in a new issue