Skip to content

Commit

Permalink
wgpu-core: feature gate use of glsl and spv naga modules
Browse files Browse the repository at this point in the history
  • Loading branch information
waynr committed Jan 18, 2024
1 parent 79c4046 commit ce5ad2a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions wgpu-core/src/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,15 @@ impl fmt::Display for ShaderError<naga::front::wgsl::ParseError> {
write!(f, "\nShader '{label}' parsing {string}")
}
}
#[cfg(feature = "glsl")]
impl fmt::Display for ShaderError<naga::front::glsl::ParseError> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let label = self.label.as_deref().unwrap_or_default();
let string = self.inner.emit_to_string(&self.source);
write!(f, "\nShader '{label}' parsing {string}")
}
}
#[cfg(feature = "spirv")]
impl fmt::Display for ShaderError<naga::front::spv::Error> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let label = self.label.as_deref().unwrap_or_default();
Expand Down

0 comments on commit ce5ad2a

Please sign in to comment.