Skip to content

Fixes for camera output swap chain acquisition and view target rendering#23959

Merged
alice-i-cecile merged 8 commits intobevyengine:mainfrom
processing:view-target-and-writes
Apr 25, 2026
Merged

Fixes for camera output swap chain acquisition and view target rendering#23959
alice-i-cecile merged 8 commits intobevyengine:mainfrom
processing:view-target-and-writes

Conversation

@tychedelia
Copy link
Copy Markdown
Member

We discovered in Processing when using GLFW as a windowing backend that sometimes a window is reported as occluded for the first several frames. When a camera is configured with ClearColorConfig::None, this can be problematic as the first several frames are skipped and thus do not accumulate drawing state in the ViewTarget texture. In general, when the user requests a color attachment with Load semantics, we should do our best to make sure that we write into that texture, as missing/dropped frames my result in visually incorrect output.

A few related fixes:

  1. Make out_texture and Option in ViewTarget. A valid render target texture is not required in order to render if the user has requested view target Load semantics. We still skip rendering when the user has requested Clear as this output will be overwritten anyway, saving some energy (i.e. preserves the previous behavior).
  2. Skip acquiring the swapchain if no camera is configured to CameraOutputMode::Write to a swapchain. This should help avoid weirdness where we acquire but don't do work on a swapchain texture.

@tychedelia tychedelia added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 23, 2026
@tychedelia tychedelia added this to the 0.19 milestone Apr 23, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Apr 23, 2026
Comment thread crates/bevy_render/src/view/mod.rs
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Very reasonable defensive programming, but needs a quick migration guide.

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Uncontroversial This work is generally agreed upon D-Straightforward Simple bug fixes and API improvements, docs, test and examples and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Apr 23, 2026
@alice-i-cecile alice-i-cecile requested a review from kfc35 April 23, 2026 21:50
@kfc35 kfc35 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 24, 2026
@Zeophlite Zeophlite added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Apr 25, 2026
@alice-i-cecile alice-i-cecile disabled auto-merge April 25, 2026 01:36
Copy link
Copy Markdown
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

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

Migration guides moved; try again :)

@alice-i-cecile alice-i-cecile added S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Apr 25, 2026
@JMS55 JMS55 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged labels Apr 25, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 25, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 25, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Apr 25, 2026
Merged via the queue into bevyengine:main with commit 8930a15 Apr 25, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Apr 25, 2026
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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants