Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb authored May 26, 2023
1 parent c274a99 commit bdb94ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
(`0.11.1` for `wgpu 0.15`, `0.12.1` for `wgpu 0.16`, and any later versions)

### Fixed 🩹
- [PR#1059](https://github.com/EmbarkStudios/rust-gpu/pull/1059) Fix bug where the `inline` pass would not rewrite `OpDecorate` IDs, which would subsequently loose those decorations in later DCE passes.
- [PR#1059](https://github.com/EmbarkStudios/rust-gpu/pull/1059) fixed the `inline` pass not copying `OpDecorate`s in the callee (which led to their loss).

## [0.7.0]

Expand Down
4 changes: 2 additions & 2 deletions crates/rustc_codegen_spirv/src/linker/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ impl Inliner<'_, '_> {
result
}

///Applies all rewrite rules to the decorations in the header.
/// Applies all rewrite rules to the decorations in the header.
fn apply_rewrite_for_decorations(&mut self, rewrite_rules: &FxHashMap<Word, Word>) {
// NOTE(siebencorgie): We don't care *what* decoration we rewrite atm. AFAIK there is no case where rewriting
// the decoration on inline wouldn't be valid.
for annotation_idx in 0..self.annotations.len() {
if self.annotations[annotation_idx].class.opcode == Op::Decorate {
if let Some(id) = self.annotations[annotation_idx].operands[0].id_ref_any_mut() {
if let Some(&rewrite) = rewrite_rules.get(id) {
//Copy decoration instruction and push it.
// Copy decoration instruction and push it.
let mut instcpy = self.annotations[annotation_idx].clone();
*instcpy.operands[0].id_ref_any_mut().unwrap() = rewrite;
self.annotations.push(instcpy);
Expand Down

0 comments on commit bdb94ee

Please sign in to comment.