From d0aa265eb53922d7d2f8f9836c6ebd31f4ef3c9a Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Tue, 14 Mar 2023 18:45:11 -0700 Subject: [PATCH] Don't emit ANSI colors in shader validation error messages. Fixes gfx-rs/naga#2278. --- CHANGELOG.md | 1 + wgpu-core/src/pipeline.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e49554bd48..4324159e92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -98,6 +98,7 @@ By @teoxoy in [#3534](https://github.com/gfx-rs/wgpu/pull/3534) - Allow copying of textures with copy-compatible formats. By @teoxoy in [#3528](https://github.com/gfx-rs/wgpu/pull/3528) - Improve attachment related errors. By @cwfitzgerald in [#3549](https://github.com/gfx-rs/wgpu/pull/3549) - Make error descriptions all upper case. By @cwfitzgerald in [#3549](https://github.com/gfx-rs/wgpu/pull/3549) +- Don't include ANSI terminal color escape sequences in shader module validation error messages. By @jimblandy in [#3591](https://github.com/gfx-rs/wgpu/pull/3591) #### WebGPU diff --git a/wgpu-core/src/pipeline.rs b/wgpu-core/src/pipeline.rs index 246799f057..cefeb97ba7 100644 --- a/wgpu-core/src/pipeline.rs +++ b/wgpu-core/src/pipeline.rs @@ -88,7 +88,7 @@ impl fmt::Display for ShaderError> let label = self.label.as_deref().unwrap_or_default(); let files = SimpleFile::new(label, &self.source); let config = term::Config::default(); - let mut writer = term::termcolor::Ansi::new(Vec::new()); + let mut writer = term::termcolor::NoColor::new(Vec::new()); let diagnostic = Diagnostic::error().with_labels( self.inner