Skip to content

Commit 7b7294b

Browse files
authored
Allow SPIR-V shaders to process when shader defs are present (#7772)
1 parent 2010164 commit 7b7294b

File tree

1 file changed

+1
-6
lines changed
  • crates/bevy_render/src/render_resource

1 file changed

+1
-6
lines changed

crates/bevy_render/src/render_resource/shader.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,6 @@ pub enum ProcessShaderError {
296296
"Not enough '# endif' lines. Each if statement should be followed by an endif statement."
297297
)]
298298
NotEnoughEndIfs,
299-
#[error("This Shader's format does not support processing shader defs.")]
300-
ShaderFormatDoesNotSupportShaderDefs,
301299
#[error("This Shader's format does not support imports.")]
302300
ShaderFormatDoesNotSupportImports,
303301
#[error("Unresolved import: {0:?}.")]
@@ -477,10 +475,7 @@ impl ShaderProcessor {
477475
Source::Wgsl(source) => source.deref(),
478476
Source::Glsl(source, _stage) => source.deref(),
479477
Source::SpirV(source) => {
480-
if shader_defs_unique.is_empty() {
481-
return Ok(ProcessedShader::SpirV(source.clone()));
482-
}
483-
return Err(ProcessShaderError::ShaderFormatDoesNotSupportShaderDefs);
478+
return Ok(ProcessedShader::SpirV(source.clone()));
484479
}
485480
};
486481

0 commit comments

Comments
 (0)