Skip to content

Commit

Permalink
define WGPU
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-its committed Nov 12, 2020
1 parent 434a3e6 commit eb7bf0b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -570,9 +570,15 @@ impl RenderResourceContext for WgpuRenderResourceContext {
}

fn get_specialized_shader(&self, shader: &Shader, macros: Option<&[String]>) -> Shader {
let macros: Vec<String> = macros
.unwrap_or(&[])
.iter()
.chain((&["WGPU".to_string()]).iter())
.cloned()
.collect();
let spirv_data = match shader.source {
ShaderSource::Spirv(ref bytes) => bytes.clone(),
ShaderSource::Glsl(ref source) => glsl_to_spirv(&source, shader.stage, macros),
ShaderSource::Glsl(ref source) => glsl_to_spirv(&source, shader.stage, Some(&macros)),
};
Shader {
source: ShaderSource::Spirv(spirv_data),
Expand Down

0 comments on commit eb7bf0b

Please sign in to comment.