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

Changes for bevy 0.11-dev #175

Closed
wants to merge 2 commits into from
Closed

Changes for bevy 0.11-dev #175

wants to merge 2 commits into from

Conversation

eerii
Copy link
Contributor

@eerii eerii commented Apr 12, 2023

This is a draft version of the changes needed for this project to work with bevy-main.

The main change is the new add_systems, which now takes the schedule pattern as a first parameter and a tuple of systems as the second. add_system (singular) is now deprecated.

Another breaking change was flipping the y coordinate for consistency. This means we can remove the inverted mouse in the process_input_system.

Will add more to this draft if there are further breaking changes.

@imalsogreg
Copy link

Thanks for doing this! I've noticed when running the ui example in this fork, it panics with

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/egui_node.rs:47:73

which corresponds to this line

let render_device = render_world.get_resource::<RenderDevice>().unwrap();

bevy_egui expects to find a RenderDevice resource, but there is none. The problem is limited to 0.11.0-dev (running on upstream main, the ui example works as expected).

I haven't been able to figure out what's going on. (Maybe in bevy-0.11.0-dev, inserting the RenderDevice resource happens at a later scheduler phase?

@diinki
Copy link

diinki commented May 22, 2023

I haven't been able to figure out what's going on. (Maybe in bevy-0.11.0-dev, inserting the RenderDevice resource happens at a later scheduler phase?

I believe this is correct, In the lib.rs I changed the

    // Line 587
    .init_resource::<egui_node::EguiPipeline>()
    .init_resource::<SpecializedRenderPipelines<EguiPipeline>>()
    .init_resource::<EguiTransforms>()

resources to be added by another system with the ExtractSchedule schedule, fixes the RenderDevice resource being None. but I do have another potentially unrelated bug where the fonts aren't rendering anymore, but maybe this insight helps a bit for now.

@imalsogreg
Copy link

@diinki brilliant! This worked for me. @josekoalas in case it's helpful, this commit is what gets ui working for me: imalsogreg@0393b7c

(I didn't think very carefully about the naming)

@seabassjh
Copy link

seabassjh commented Jun 8, 2023

@josekoalas @imalsogreg I was playing around with both of your changes on bevy main, but with webgpu and wasm-- and everything works great... just one thing :)

There's an error with the color attachment setup in the render pipeline pass.
I authored a fix on top of @imalsogreg's work which got it all working:
seabassjh/bevy_egui@7ee68d3

Tested on Chrome Stable version 114.
Commands I used to test WASM/Webgpu:
export RUSTFLAGS=--cfg=web_sys_unstable_apis; cargo build --release --target wasm32-unknown-unknown --example simple && wasm-bindgen --out-dir target --out-name wasm_example --target web target/wasm32-unknown-unknown/release/examples/simple.wasm && basic-http-server .

Hopefully someone can reproduce this error and fix on their machine!

@diinki
Copy link

diinki commented Jun 9, 2023

I'd like to mention that this commit changed the name of schedule::apply_system_buffers to schedule::apply_deferred.

This commit causes more necessary changes in lib.rs ( just change the name of apply_system_buffers everywhere to apply_deferred c: ).

I'll update my fork to work with the latest version of Bevy in a bit, if anyone wonders which commits would fix the bugs as well :p

seabassjh added a commit to seabassjh/bevy_egui that referenced this pull request Jul 9, 2023
See ttps://github.com/mvlabat/pull/175#issuecomment-1581792819
@mvlabat
Copy link
Owner

mvlabat commented Jul 10, 2023

I'll close it as #188 has been merged. But thank you for your work!

@mvlabat mvlabat closed this Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants