You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After moving a compute shader study project to a multi-package workspace and setting up a shared asset folder, I encountered an unreachable code panic deep in Naga during shader pipeline compilation. At first, I thought it was caused by the shared folder or a bug in my shaders.
However, I later discovered that the error occurred in any multi-package Bevy project that had both asset creation and a camera — regardless of the actual shaders used. I spent hours trying to identify the issue: clearing caches, resetting my Rust environment, updating/downgrading graphics drivers, etc.
Eventually, I found that the root cause was simply that my workspace's Cargo.toml was missing:
[workspace]
resolver = "2"
Once I added that, the problem disappeared immediately.
After the fact I've realized this is mentioned in the quick-start guide, but by the time this kind of failure happens — possibly days or weeks into a project — most users won’t think to find solutions there. And the error message points to naga::back::glsl or naga_oil, so it’s easy to get misled into debugging shaders or asset loading code instead.
Would it be possible to:
Emit a warning or error at runtime or build time if resolver = "2" is not set in a workspace?
Or, at the very least, add a diagnostic pointing to this from the panic?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
After moving a compute shader study project to a multi-package workspace and setting up a shared asset folder, I encountered an
unreachable code
panic deep in Naga during shader pipeline compilation. At first, I thought it was caused by the shared folder or a bug in my shaders.However, I later discovered that the error occurred in any multi-package Bevy project that had both asset creation and a camera — regardless of the actual shaders used. I spent hours trying to identify the issue: clearing caches, resetting my Rust environment, updating/downgrading graphics drivers, etc.
Eventually, I found that the root cause was simply that my workspace's
Cargo.toml
was missing:Once I added that, the problem disappeared immediately.
After the fact I've realized this is mentioned in the quick-start guide, but by the time this kind of failure happens — possibly days or weeks into a project — most users won’t think to find solutions there. And the error message points to
naga::back::glsl
ornaga_oil
, so it’s easy to get misled into debugging shaders or asset loading code instead.Would it be possible to:
resolver = "2"
is not set in a workspace?Thanks for the amazing work on Bevy!
Beta Was this translation helpful? Give feedback.
All reactions