Skip to content

Commit

Permalink
Add Deref implementation for ComputePipeline (#2759)
Browse files Browse the repository at this point in the history
# Objective

Fixes a usability problem where the user is unable to use their reference to a ComputePipeline in their compute pass.

## Solution

Implements Deref, allowing the user to obtain the reference to the underlying wgpu::ComputePipeline
  • Loading branch information
lwansbrough committed Aug 31, 2021
1 parent 045f324 commit 59bfbd3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pipelined/bevy_render2/src/render_resource/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ impl From<wgpu::ComputePipeline> for ComputePipeline {
}
}
}

impl Deref for ComputePipeline {
type Target = wgpu::ComputePipeline;

#[inline]
fn deref(&self) -> &Self::Target {
&self.value
}
}

0 comments on commit 59bfbd3

Please sign in to comment.