Use RenderStartup for bevy_solari.#19918
Conversation
|
This PR is based off of #19912 so we don't have to restructure how we add render graph nodes. I will wait for that before sending it out for review. |
2b369a7 to
a770f7d
Compare
|
I really don't like this solution :/. It really complicates the solari code. Perhaps we could make a generic version of this that multiple plugins could use? |
|
@JMS55 I'm not sure I agree that this complicates the solari code significantly. The only part that isn't specific to solari code is I think the fact that we have to configure the system sets 3 times. I tried drafting this up and it's quite gross 0da4a59 In theory the To me, this seems like a lot of complexity that makes it less clear what's going on and why. Looking through our code, here are these cases with
Feel free to investigate, but the TL;DR for what these conditionals access is:
That's quite a mix of things we access, so it's not as simple as adding a run condition for features or something (plus I want to make the run conditions themselves as cheap as possible). |
|
To me this doesn't look particularly that complicated. It's a bit more setup code, but it also makes things more explicit which I think is valuable. I like the idea of a HasRequiredFeatures resource for a run condition. With that said, I'm not entirely sure the system sets is strictly needed? It's only used in a few places and it only exists for the purpose of the run condition but I feel like adding the run condition directly where it's needed might be more explicit and lead to overall a bit less code? We can always add back the system set in the future if we need more complex scheduling. |
| /// are enabled. | ||
| /// | ||
| /// Now systems can do a cheap check for if the resource exists. | ||
| fn check_solari_has_required_features(mut commands: Commands, render_device: Res<RenderDevice>) { |
There was a problem hiding this comment.
I'm a bit confused where is this system actually added to RenderStartup?
There was a problem hiding this comment.
I totally goofed haha. I added the system now!
a770f7d to
fcdc082
Compare
|
Due to the refactors from |
Objective
Solution
SolariSystemssystem set that all systems belong to.SolariSystemsto only execute systems if the resource is present.Testing
solariexample, and it still works.