Skip to content

Commit

Permalink
Avoid a clone when creating a Glsl shader (gfx-rs#5118)
Browse files Browse the repository at this point in the history
  • Loading branch information
a1phyr authored and cwfitzgerald committed Feb 29, 2024
1 parent 7bc7220 commit c27f743
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Bottom level categories:
- Fix performance regression when allocating a large amount of resources of the same type. By @nical in [#5229](https://github.com/gfx-rs/wgpu/pull/5229)
- Fix docs.rs wasm32 builds. By @cwfitzgerald in [#5310](https://github.com/gfx-rs/wgpu/pull/5310)
- Improve error message when binding count limit hit. By @hackaugusto in [#5298](https://github.com/gfx-rs/wgpu/pull/5298)
- Remove an unnecessary `clone` during GLSL shader injestion. By @a1phyr in [#5118](https://github.com/gfx-rs/wgpu/pull/5118).

#### DX12
- Fix `panic!` when dropping `Instance` without `InstanceFlags::VALIDATION`. By @hakolao in [#5134](https://github.com/gfx-rs/wgpu/pull/5134)
Expand Down
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 c27f743

Please sign in to comment.