add support for .comp glsl shaders (#6084)

# Objective

- Support `.comp` extension for glsl compute shaders

## Solution

- Add `.comp` to the shader asset loader
This commit is contained in:
Charles 2022-09-27 01:30:40 +00:00
parent dc3f801239
commit deb07fe957

View file

@ -254,6 +254,10 @@ impl AssetLoader for ShaderLoader {
String::from_utf8(Vec::from(bytes))?, String::from_utf8(Vec::from(bytes))?,
naga::ShaderStage::Fragment, naga::ShaderStage::Fragment,
), ),
"comp" => Shader::from_glsl(
String::from_utf8(Vec::from(bytes))?,
naga::ShaderStage::Compute,
),
_ => panic!("unhandled extension: {}", ext), _ => panic!("unhandled extension: {}", ext),
}; };
@ -279,7 +283,7 @@ impl AssetLoader for ShaderLoader {
} }
fn extensions(&self) -> &[&str] { fn extensions(&self) -> &[&str] {
&["spv", "wgsl", "vert", "frag"] &["spv", "wgsl", "vert", "frag", "comp"]
} }
} }