Skip to content

Properly check for result when getting pipeline in Msaa#11758

Merged
alice-i-cecile merged 1 commit intobevyengine:mainfrom
BorisBoutillier:fix_msaa_crash_if_render_pipeline_not_ready
Feb 7, 2024
Merged

Properly check for result when getting pipeline in Msaa#11758
alice-i-cecile merged 1 commit intobevyengine:mainfrom
BorisBoutillier:fix_msaa_crash_if_render_pipeline_not_ready

Conversation

@BorisBoutillier
Copy link
Copy Markdown
Contributor

Objective

Solution

  • Check get_render_pipeline call result for msaa_writeback
  • I checked that no other call to get_render_pipeline in bevy code base is missng the checking on the result.

@mockersf mockersf added the A-Rendering Drawing game state to the screen label Feb 7, 2024
@mockersf mockersf added this to the 0.13 milestone Feb 7, 2024
Copy link
Copy Markdown
Contributor

@afonsolage afonsolage left a comment

Choose a reason for hiding this comment

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

Tested and is working fine!

Just a question: The problems seems to be caused by some ordering issue on async pipeline compilation, so guarding the PipelineCache won't hide the underlying issue?

I mean, returning Ok(()) will disable the msaa_writeback and fix the crash, but I'm missing something or this will sometimes enable msaa_writeback and sometimes not, depending on the order in which the async pipeline compilation ran?

@BorisBoutillier
Copy link
Copy Markdown
Contributor Author

I mean, returning Ok(()) will disable the msaa_writeback and fix the crash, but I'm missing something or this will sometimes enable msaa_writeback and sometimes not, depending on the order in which the async pipeline compilation ran?

I am not a full rendering expert, but as far as I understand it, the pipeline only needs to be compiled once, but it can take time some time to compile and now that it is spawned, more than one frame ( the spawning itself can take some time, probably what happens with the example). After compilation, the pipeline will be run each frame, the protection prevent the pipeline to be run while its compilation is not yet finished.

So the first few frames of the example can have no msaa, but afterwards it will always be enabled.
I checked it with some printing, and effectively I can have up to ~10 frame without the pipeline ready, then it is always there.

@alice-i-cecile alice-i-cecile added the C-Bug An unexpected or incorrect behavior label Feb 7, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 7, 2024
Merged via the queue into bevyengine:main with commit c33b8b9 Feb 7, 2024
@BorisBoutillier BorisBoutillier deleted the fix_msaa_crash_if_render_pipeline_not_ready branch February 7, 2024 17:17
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 this pull request may close these issues.

two_passes example breaking on Windows

4 participants