Skip to content

Commit

Permalink
add support for .comp glsl shaders (#6084)
Browse files Browse the repository at this point in the history
# Objective

- Support `.comp` extension for glsl compute shaders

## Solution

- Add `.comp` to the shader asset loader
  • Loading branch information
IceSentry committed Sep 27, 2022
1 parent dc3f801 commit deb07fe
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/bevy_render/src/render_resource/shader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,10 @@ impl AssetLoader for ShaderLoader {
String::from_utf8(Vec::from(bytes))?,
naga::ShaderStage::Fragment,
),
"comp" => Shader::from_glsl(
String::from_utf8(Vec::from(bytes))?,
naga::ShaderStage::Compute,
),
_ => panic!("unhandled extension: {}", ext),
};

Expand All @@ -279,7 +283,7 @@ impl AssetLoader for ShaderLoader {
}

fn extensions(&self) -> &[&str] {
&["spv", "wgsl", "vert", "frag"]
&["spv", "wgsl", "vert", "frag", "comp"]
}
}

Expand Down

0 comments on commit deb07fe

Please sign in to comment.