-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #33 this should not merged until bevy 0.11.1 is out. builds on @VitalyAnkh's partial migration, with additionally : - use `Rc<RefCell>` for `const_expressions` and `const_expr_map` - this is basically unavoidable, as `DerivedModule::import_expression` needs access to both the `const_expressions` and the arena to import into, which may also be `const_expressions` - don't emit `Expression::Literal` and `Expression::ZeroValue`s - enforce `const_expression` uniqueness with a custom impl of `PartialEq` for `Expression`s, to ensure that the uniqueness test for globals and consts still passes (else we end up with duplicated items, they no longer test as equal as they refer to different `init` expressions). this could be removed if the `PartialEq` derive on `Expression` in naga is made externally available. - a basic port of the `prune` module which just leaves all `const_expressions` present the tests pass, but i haven't tried integrating into bevy (which will require bevy to use wgpu 0.17). --------- Co-authored-by: VitalyR <[email protected]>
- Loading branch information
1 parent
9344d35
commit 1854567
Showing
13 changed files
with
464 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
var<private> _naga_oil_mod_NVXWI_membera: f32 = 0.0; | ||
|
||
fn add() { | ||
let _e2: f32 = _naga_oil_mod_NVXWI_membera; | ||
_naga_oil_mod_NVXWI_membera = (_e2 + 1.0); | ||
return; | ||
} | ||
|
||
fn main() -> f32 { | ||
add(); | ||
add(); | ||
let _e1: f32 = _naga_oil_mod_NVXWI_membera; | ||
return _e1; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#define_import_path mod | ||
|
||
var<private> a: f32 = 0.0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#import mod | ||
|
||
fn add() { | ||
mod::a += 1.0; | ||
} | ||
|
||
fn main() -> f32 { | ||
add(); | ||
add(); | ||
return mod::a; | ||
} |
Oops, something went wrong.