Skip to content

Commit

Permalink
add support for .comp glsl shaders (bevyengine#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 authored and james7132 committed Oct 19, 2022
1 parent 6cd4c52 commit e6ad1ea
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 e6ad1ea

Please sign in to comment.