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 28, 2022
1 parent 4a723af commit 068af02
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/bevy_render/src/render_resource/shader.rs
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 068af02

Please sign in to comment.