-
A GPUCompilationMessage has a However, if we have a cyclic dependency, like the following fn foo() -> u32 {
return bar();
}
fn bar() -> u32 {
return baz();
}
fn baz() -> u32 {
return foo();
} then which line caused the error? What should the GPUCompilationMessage's linePos say? Both naga and Chrome's Tint can internally generate multiple locations for this and a few other errors. For what it's worth, the text of the error message will indicate where the error happened. However, websites like Shadertoy and https://compute.toys/ would have to
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I'm not sure what you're asking for. AFAICT, the spec requires the WGSL to fail but it doesn't require any specific error message or line numbers. Those are entirely undefined and up to the implementation. It's fine for it to just say "bad WGSL" and nothing else. That's intentional as it is in every other GPU API since they may all take different paths to get to an error. All that's required is they don't allow invalid code. That said, I'm not sure what you're asking for that's not already there. When I run this in Chrome I I call And here's an example highlighting each line based on that info |
Beta Was this translation helpful? Give feedback.
I'm not sure what you're asking for. AFAICT, the spec requires the WGSL to fail but it doesn't require any specific error message or line numbers. Those are entirely undefined and up to the implementation. It's fine for it to just say "bad WGSL" and nothing else. That's intentional as it is in every other GPU API since they may all take different paths to get to an error. All that's required is they don't allow invalid code.
That said, I'm not sure what you're asking for that's not already there. When I run this in Chrome I I call
module.getCompilationInfo
and it returns all the data required to highlight each line, no parsing required.And here's an example highlighting each line based …