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

Upstream naga_oil #16491

Open
wants to merge 230 commits into
base: main
Choose a base branch
from
Open

Conversation

tychedelia
Copy link
Contributor

naga_oil is a foundational crate for Bevy, but doesn't get enough love from community maintainers. We should include it in the monorepo so that it gets more care and attention. The crate was originally left out of the repo under the "useful to other external users" metric. However, since then, we have included other crates like bevy_color in the monorepo under and haven't seen uptake from external users that benefits naga_oil maintenence.

On the horizon, WESL promises to solve a lot of problems that we currently rely on naga_oil for. However, in the meantime, there are a number of important initiatives that would benefit from improvements made to naga_oil, including future initiatives like upstreaming bevy_hanabi and improvements to AsBindGroup that may require code generation strategies. Additionally, there are number of outstanding bugs ex. bevyengine/naga_oil#54 that are more likely to get fixed if they live in our issue tracker.

Changes

  • History imported so we can have a record all the hard work @robtfm has done here.
  • The crate has been renamed to bevy_naga_oil so that its version can be reset to match the rest of the bevy crates.
  • Internal crates point to bevy_naga_oil.

@tychedelia tychedelia added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Nov 23, 2024
@tychedelia tychedelia added this to the 0.16 milestone Nov 24, 2024
@tychedelia
Copy link
Contributor Author

Realizing that the squash merge will obliterate the history, unfortunately.

crates/bevy_naga_oil/Cargo.toml Outdated Show resolved Hide resolved
crates/bevy_naga_oil/README.md Outdated Show resolved Hide resolved
crates/bevy_naga_oil/README.md Outdated Show resolved Hide resolved
crates/bevy_naga_oil/README.md Outdated Show resolved Hide resolved
crates/bevy_naga_oil/README.md Outdated Show resolved Hide resolved

match module_set {
None => {
// TODO this should be unreachable?
Copy link
Contributor

Choose a reason for hiding this comment

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

This should have an open issue or an unreachable!() with a better comment explaining why


if self.validate && create_headers {
// check that identifiers haven't been renamed
#[allow(clippy::single_element_loop)]
Copy link
Contributor

Choose a reason for hiding this comment

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

There is probably a better way to handle this

Ok(composable_module)
}

// shunt all data owned by a composable into a derived module
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// shunt all data owned by a composable into a derived module
/// Shunts all data owned by a composable into a derived module.

derived.clear_shader_source();
}

// add an import (and recursive imports) into a derived module
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// add an import (and recursive imports) into a derived module
/// Adds an import (and recursive imports) into a derived module.

.map_err(|err| err.into())
}

// build required ComposableModules for a given set of shader_defs
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// build required ComposableModules for a given set of shader_defs
// Builds the required [`ComposableModules`] for a given set of shader_defs.

@tychedelia
Copy link
Contributor Author

Thanks for all the copyediting @BenjaminBrienen! It's very much appreciated.

@doup
Copy link
Contributor

doup commented Nov 25, 2024

Realizing that the squash merge will obliterate the history, unfortunately.

If it's interesting to keep the history then someone with privileges could merge it instead?

@@ -0,0 +1,203 @@
# Bevy Naga Oil

Bevy Naga Organized Integration Library (`bevy_naga-oil`) is a crate for combining and manipulating shaders.
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason to mix _ and -? It's already bad that Rust crates use both, but within the same name...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh no that's just a mistake!

@BenjaminBrienen BenjaminBrienen added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged D-Complex Quite challenging from either a design or technical perspective. Ask for help! and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Dependencies A change to the crates that Bevy depends on D-Complex Quite challenging from either a design or technical perspective. Ask for help! S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Controversial There is active debate or serious implications around merging this PR
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.