From e6ad1ea95e3f503ebf81b575b51b310389d4790f Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 27 Sep 2022 01:30:40 +0000 Subject: [PATCH] add support for .comp glsl shaders (#6084) # Objective - Support `.comp` extension for glsl compute shaders ## Solution - Add `.comp` to the shader asset loader --- crates/bevy_render/src/render_resource/shader.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/bevy_render/src/render_resource/shader.rs b/crates/bevy_render/src/render_resource/shader.rs index 5913d44dd3aab1..beee76e6f25a55 100644 --- a/crates/bevy_render/src/render_resource/shader.rs +++ b/crates/bevy_render/src/render_resource/shader.rs @@ -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), }; @@ -279,7 +283,7 @@ impl AssetLoader for ShaderLoader { } fn extensions(&self) -> &[&str] { - &["spv", "wgsl", "vert", "frag"] + &["spv", "wgsl", "vert", "frag", "comp"] } }