Skip to content

Commit

Permalink
Avoid a clone when creating a Glsl shader (#5118)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr authored Jan 22, 2024
1 parent 2ee7604 commit 20f3a9f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions wgpu/src/backend/wgpu_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -852,13 +852,10 @@ impl crate::Context for ContextWgpuCore {
ShaderSource::Glsl {
ref shader,
stage,
ref defines,
defines,
} => {
// Parse the given shader code and store its representation.
let options = naga::front::glsl::Options {
stage,
defines: defines.clone(),
};
let options = naga::front::glsl::Options { stage, defines };
let mut parser = naga::front::glsl::Frontend::default();
let module = parser.parse(&options, shader).unwrap();

Expand Down

0 comments on commit 20f3a9f

Please sign in to comment.