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

[Merged by Bors] - Allow minimising in 2d #4527

Closed
wants to merge 2 commits into from

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Apr 18, 2022

Objective

Solution

@DJMcNab DJMcNab added C-Bug An unexpected or incorrect behavior A-Windowing Platform-agnostic interface layer to run your app in C-Regression Functionality that used to work but no longer does. Add a test for this! labels Apr 18, 2022
@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Apr 18, 2022
Copy link
Contributor

@superdump superdump left a comment

Choose a reason for hiding this comment

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

Hmm, I am wondering what view entity is passed in if there is no such entity matching the query.

crates/bevy_core_pipeline/src/main_pass_2d.rs Outdated Show resolved Hide resolved
@superdump
Copy link
Contributor

I also wonder why this should panic instead of just returning an error. The Node::run are supposed to be fallible.

@mockersf
Copy link
Member

mockersf commented Apr 28, 2022

the panic is thread 'main' panicked at 'view entity should exist: QueryDoesNotMatch(0v0)', crates\bevy_core_pipeline\src\main_pass_2d.rs:45:14, so panicking on the expect there. Should it return a NodeRunError in this case?

This PR makes it returns a Ok(()) which swallows the error

@tim-blackbird
Copy link
Contributor

A similar change was made to main_pass_3d.rs in #3330, which Cart approved.

@mockersf
Copy link
Member

mockersf commented May 8, 2022

can't reproduce the initial crash, but the code change makes sense

@mockersf mockersf added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label May 8, 2022
@superdump
Copy link
Contributor

Why is there no view when the window is minimised?

@superdump
Copy link
Contributor

Also, how come this only affects 2d?

@DJMcNab
Copy link
Member Author

DJMcNab commented May 9, 2022

I don't know why this happens whilst minimised. Presumably we have some code that prevents creating swapchain textures of size 0.

And as @devil-ira mentioned, #3330 added the same thing for 3d, hence that not crashing.

@alice-i-cecile
Copy link
Member

alice-i-cecile commented May 15, 2022

@DJMcNab, #4757 does the same thing for UI cameras. Can you roll in that fix and credit the author?

@DJMcNab
Copy link
Member Author

DJMcNab commented May 15, 2022

I can do if someone makes a pr against the branch for it 😆

I'm not in a context where I can do any manual git operations at the moment

@hoshino111
Copy link
Contributor

I just made a pr against your branch. 👌

@DJMcNab
Copy link
Member Author

DJMcNab commented May 15, 2022

I guess we should add a UI camera to the minimising and resizing examples too

@alice-i-cecile alice-i-cecile added the A-Rendering Drawing game state to the screen label May 16, 2022
@mockersf
Copy link
Member

soon ©️ (#4745) the ui camera will be a component on existing cameras

Add a comment
@alice-i-cecile
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request May 30, 2022
# Objective

- We can't minimise if there's a 2d camera because ??? there legally must be a 2d target.
- Fixes #4526
- Fixes #4856

## Solution

- Make it not crash in those cases, just do nothing
- Seems to work ¯\\_(ツ)_/¯
- See also the companion commit in #3597 - 503c247

Co-authored-by: Asteria <asteria131@outlook.com>
@bors bors bot changed the title Allow minimising in 2d [Merged by Bors] - Allow minimising in 2d May 30, 2022
@bors bors bot closed this May 30, 2022
james7132 pushed a commit to james7132/bevy that referenced this pull request Jun 7, 2022
# Objective

- We can't minimise if there's a 2d camera because ??? there legally must be a 2d target.
- Fixes bevyengine#4526
- Fixes bevyengine#4856

## Solution

- Make it not crash in those cases, just do nothing
- Seems to work ¯\\_(ツ)_/¯
- See also the companion commit in bevyengine#3597 - 503c247

Co-authored-by: Asteria <asteria131@outlook.com>
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

- We can't minimise if there's a 2d camera because ??? there legally must be a 2d target.
- Fixes bevyengine#4526
- Fixes bevyengine#4856

## Solution

- Make it not crash in those cases, just do nothing
- Seems to work ¯\\_(ツ)_/¯
- See also the companion commit in bevyengine#3597 - 503c247

Co-authored-by: Asteria <asteria131@outlook.com>
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 A-Windowing Platform-agnostic interface layer to run your app in C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this! S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI crashes if a UI camera is removed Minimizing window with 2d camera causes a crash
7 participants