Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dxc error message formatting #3632

Merged
merged 4 commits into from
Apr 10, 2023

Conversation

Davidster
Copy link
Contributor

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
n/a

Description
Currently, error messages from dxc are not included in the error messages reported by wgpu. Before this change, error messages would look like this:

[2023-04-01T19:51:14Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `iced_wgpu::quad pipeline`
    Internal error in VERTEX shader: DXC compile error: DxcOperationResult { inner: ComPtr { ptr: 0x1c754cd23c0 } }

', wgpu\src\backend\direct.rs:3016:5

After this change, they look like this:

[2023-04-01T19:49:53Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error

Caused by:
    In Device::create_render_pipeline
      note: label = `iced_wgpu::quad pipeline`
    Internal error in VERTEX shader: DXC compile error: "error: error reading 'iced_wgpu::quad::shader'\n\0"

', wgpu\src\backend\direct.rs:3016:5

Testing
The change can be tested by triggering a dxc compile error, which can be triggered by adding a colon in the name of the shader module:

wgpu::ShaderModuleDescriptor {
    label: Some(":"),
    ..
}

@Elabajaba
Copy link
Contributor

LGTM.

I don't love the closure, but that's just nitpicking over style.

@Davidster Davidster requested a review from Elabajaba April 9, 2023 22:53
@cwfitzgerald cwfitzgerald merged commit 4d15567 into gfx-rs:trunk Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants