Skip to content

Commit

Permalink
Replace code with naga built-in (#85)
Browse files Browse the repository at this point in the history
naga::Expression now implements PartialEq, which lets us get rid of this
code :D

Looks like @robtfm 's commit is now paying off nicely

gfx-rs/wgpu@d0d3a2e
  • Loading branch information
stefnotch authored Apr 28, 2024
1 parent 33e57e4 commit 37a472c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 271 deletions.
1 change: 0 additions & 1 deletion src/compose/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ pub mod parse_imports;
pub mod preprocess;
mod test;
pub mod tokenizer;
pub mod util;

#[derive(Hash, PartialEq, Eq, Clone, Copy, Debug, Default)]
pub enum ShaderLanguage {
Expand Down
267 changes: 0 additions & 267 deletions src/compose/util.rs

This file was deleted.

4 changes: 1 addition & 3 deletions src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ use naga::{
};
use std::{cell::RefCell, rc::Rc};

use crate::compose::util::expression_eq;

#[derive(Debug, Default)]
pub struct DerivedModule<'a> {
shader: Option<&'a Module>,
Expand Down Expand Up @@ -602,7 +600,7 @@ impl<'a> DerivedModule<'a> {
new_expressions.borrow_mut().fetch_if_or_append(
expr,
self.map_span(span),
expression_eq,
|lhs, rhs| lhs == rhs,
)
} else {
new_expressions
Expand Down

0 comments on commit 37a472c

Please sign in to comment.