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

Reproduce Naga's nicer error reporting for WGSL #1424

Closed
wants to merge 2 commits into from

Conversation

almarklein
Copy link
Contributor

Closes gfx-rs/wgpu-native#104

Basically, I find myself copying WGSL code to a file and running Naga from the command line on it, because that way I get prettier errors than when pushing the (faulty) WGSL via wgpu-native's create_shader_module. Would be nice if the error reports were equally good.

WIP: does not seem to help yet, except duplicating part of the error message.

@ElectronicRU
Copy link
Contributor

shouldn't this be using error.description()?

@cwfitzgerald
Copy link
Member

@ElectronicRU no, description is deprecated in favor of display

match naga::front::wgsl::parse_str(&code) {
Ok(module) => (None, Some(module)),
Err(err) => {
log::error!("Failed to parse WGSL code for {:?}: {}", desc.label, err);
log::error!("{}:", err);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err is already printed in the previous line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I know. I just copied some lines over, without cleaning it up. At the moment this does nothing except print the error message twice :)

@cwfitzgerald
Copy link
Member

Any progress on this?

@almarklein
Copy link
Contributor Author

Any progress on this?

Not from my end, I'm not sure how to proceed tbh.

@kvark
Copy link
Member

kvark commented Aug 3, 2021

Closed by #1760

@kvark kvark closed this Aug 3, 2021
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.

Naga error messages not as useful as they could be
4 participants