Skip to content

fix(bevy_core_pipeline): remove early return in 2d main opaque pass - #25199

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
MickHarrigan:opaque-2d-pass
Jul 28, 2026
Merged

fix(bevy_core_pipeline): remove early return in 2d main opaque pass#25199
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
MickHarrigan:opaque-2d-pass

Conversation

@MickHarrigan

Copy link
Copy Markdown
Contributor

Objective

Fixes clear_color example that was broken due to #24850 by requiring 2d opaque passes to not early return, as referenced by this comment.

Solution

Removed the early return in main_opaque_pass_2d() such that it follows the same general shape as main_opaque_pass_3d().
Again, this comes from @beicause's comment:

just a heads up, this PR breaks the clear_color example. Just confirmed on both macos and linux personally

Both opaque_pass_2d and transparent_pass_2d skip render pass when there are no items. But at least one of them should always run to clear the texture.

Although the reason to always run transparent_pass_2d could be that transparent objects are more common than opaque objects in 2D, I think it's better to make opaque_pass_2d always run to be consistent with opaque_pass_3d.

Testing

Tested the aforementioned clear_color example which now works again as expected, along with the 2d_shapes and transparency_2d examples.

@github-actions

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen labels Jul 28, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jul 28, 2026
@kfc35 kfc35 added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 28, 2026

@kfc35 kfc35 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Tested and verified, and I agree with the solution

@kfc35 kfc35 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 Jul 28, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Jul 28, 2026
Merged via the queue into bevyengine:main with commit 820d7ab Jul 28, 2026
47 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Jul 28, 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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants