From f2e40a409d714f1beec64f9afe176f5142e2025a Mon Sep 17 00:00:00 2001 From: Andreas Reich Date: Mon, 29 Apr 2024 13:51:50 +0200 Subject: [PATCH] move shader compilation error query out of 0.20 changelog - it didn't get released with it --- CHANGELOG.md | 54 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17ec36d11c..538546e4c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,39 @@ Bottom level categories: ## Unreleased +### Major Changes + +#### Querying shader compilation errors + +Wgpu now supports querying [shader compilation info](https://www.w3.org/TR/webgpu/#dom-gpushadermodule-getcompilationinfo). + +This allows you to get more structured information about compilation errors, warnings and info: +```rust +... +let lighting_shader = ctx.device.create_shader_module(include_wgsl!("lighting.wgsl")); +let compilation_info = lighting_shader.get_compilation_info().await; +for message in compilation_info + .messages + .iter() + .filter(|m| m.message_type == wgpu::CompilationMessageType::Error) +{ + let line = message.location.map(|l| l.line_number).unwrap_or(1); + println!("Compile error at line {line}"); +} +``` + +By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410) + + + +### New features + +#### General + +#### Naga + +### Bug Fixes + ## v0.20.0 (2024-04-28) ### Major Changes @@ -73,27 +106,6 @@ Due to a specification change `write_timestamp` is no longer supported on WebGPU By @wumpf in [#5188](https://github.com/gfx-rs/wgpu/pull/5188) -#### Querying shader compilation errors - -Wgpu now supports querying [shader compilation info](https://www.w3.org/TR/webgpu/#dom-gpushadermodule-getcompilationinfo). - -This allows you to get more structured information about compilation errors, warnings and info: -```rust -... -let lighting_shader = ctx.device.create_shader_module(include_wgsl!("lighting.wgsl")); -let compilation_info = lighting_shader.get_compilation_info().await; -for message in compilation_info - .messages - .iter() - .filter(|m| m.message_type == wgpu::CompilationMessageType::Error) -{ - let line = message.location.map(|l| l.line_number).unwrap_or(1); - println!("Compile error at line {line}"); -} -``` - -By @stefnotch in [#5410](https://github.com/gfx-rs/wgpu/pull/5410) - #### Wgsl const evaluation for many more built-ins