-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
use naga instead of spirv-reflect for shader reflection #2130
Conversation
I presume that |
Sounds like we have this tested on linux already. If we can verify the other glsl-to-spirv platforms (windows, macos) I think we're good to go! I'd like to verify android too, but its currently broken for other reasons, which will make that job hard. |
To clarify: "If we can verify the other glsl-to-spirv platforms using the just-merged glsl-to-spirv version then we're good to go". We will need to sort out the following issue before we can publish a new glsl-to-spirv version: cart/glsl-to-spirv#12. I'll ping the crates.io team to request a size increase for the new crate. (which I consider a prerequisite to merging this pr) |
What exactly do I need to do to test this? |
on macOS, after using this pr and changing
|
Checkout this pr, checkout the glsl-to-spirv pr with the fix, edit bevy_render's cargo.toml to point to the local glsl-to-spirv checkout containing the PR changes, run a 3d example. |
I just:
No problems. |
@mockersf it seems like cargo can't handle |
works fine by pointing to a local clone 👍 |
Doesn't work yet as expected, because naga seems to ignore the `readonly` attribute: gfx-rs/naga#848
glsl-to-spirv seems to segfault sometimes when being called from multiple test threads
…andle for bindings
Just a note that this fixes #2122 for me on macOS. I have tested |
At this point we're just blocked on a bevy-glsl-to-spirv release (see the comments about it above). I reached out to the crates.io team awhile back and they're cool with bumping the limit on the new crate, so I just need to publish an empty version of the crate, have them bump the limit on the crate, then publish the real version of the crate. |
Just published the empty crate and asked the crates.io team to bump the size limit. |
Unrelated to the switch to naga, but I just remembered that when updating |
Is this still relevant with the |
It might inform future reflection work, but the types have all changed a lot and so far we've been favoring a more explicit model. Auto-reflection on the level of the current bevy_render is too opinionated in a number of areas. I do think that we eventually might want something a bit more automatic, but I think we'll need to revisit the interfaces to ensure we aren't restricting things too much. I'll close this for now. |
Replaces spirv-reflect with naga only for shader reflection. The glsl to spirv compilation ist still done using
beyv-glsl-to-spirv
.For some reason the
spirv-reflect
dependency can't be removed though, because I then get a ton of linker errors (fixed in cart/glsl-to-spirv#13):Errors
This could allow shader reflection to work on wasm, however I'm not sure if that is useful, as spirv isn't used in wasm contexts IIRC.
It should also fix a bug with spirv-reflect @mtsr was experiencing which lead to
CubeArray
images being incorrectly reflected asCube
.fixes #2122