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

Pipelined Rendering: App crashes when there is no camera #3043

Closed
cart opened this issue Oct 28, 2021 · 5 comments
Closed

Pipelined Rendering: App crashes when there is no camera #3043

cart opened this issue Oct 28, 2021 · 5 comments
Labels
A-Rendering Drawing game state to the screen C-Bug An unexpected or incorrect behavior
Milestone

Comments

@cart
Copy link
Member

cart commented Oct 28, 2021

Crashes with the following:

Oct 28 16:01:38.927 ERROR present_frames: wgpu_core::present: No work has been submitted for this frame    
Oct 28 16:01:38.932 ERROR present_frames: wgpu_core::present: No work has been submitted for this frame    
thread 'main' panicked at 'Failed to acquire next swap chain texture!: Timeout', pipelined/bevy_render2/src/view/window.rs:151:24

We should choose one of the following behaviors:

  1. Don't call "present" when there is nothing to draw for a camera
  2. Run a "clear color" pass anyway.

We should also print an error (once) when a camera is missing.

@cart cart added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Oct 28, 2021
@cart cart added this to the Bevy 0.6 milestone Oct 28, 2021
@louiidev
Copy link
Contributor

Hey @cart, can I pick this one up?

@mockersf
Copy link
Member

Not Cart, but yes please do! Be sure to fix it in pipelined-rendering branch, in pipelined/bevy_render2, not in crates/bevy_render

@louiidev
Copy link
Contributor

Not Cart, but yes please do! Be sure to fix it in pipelined-rendering branch, in pipelined/bevy_render2, not in crates/bevy_render

thanks for the heads up

@cart
Copy link
Member Author

cart commented Nov 2, 2021

Yup definitely feel free to pick this up. Sorry for the delay!

@Davier
Copy link
Contributor

Davier commented Nov 5, 2021

This panic also occurs for me in the pipelined_texture_atlas when compiled in debug mode (even though there is a camera). I believe it's fine in release mode because the texture is loaded in less than a few frames, so that there is something to draw.

bors bot pushed a commit that referenced this issue Dec 9, 2021
# Objective

- Rendering before MainPass should be possible, so clearing needs to happen in an earlier pass.
- Fixes #3190.

## Solution

- I added a "Clear" SubGraph, a "ClearPassNode" Node, that clears the color and depth attachments of all views and a "ClearNodeDriver" Node, that schedules the "ClearPassNode" before MainPass.
- Make sure that the 2d and 3d draw passes do not clear their attachments anymore.

### Notes

- It works in the way, that with the current pipeline examples nothing should have changed in their behaviour
- I would like to add an example that adds a pass inbetween ClearPass and MainPass, but I do not understand enough about the new render architecture to do that yet
- Clears all attachment for all views: I do not know enough about rendering in general to say, whether there is a use case for not clearing
- Does not solve #3043 as we still need Cameras/ViewTargets to clear.
@bors bors bot closed this as completed in fe9b500 Dec 12, 2021
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-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants