Skip to content

Render phase changes#24980

Merged
alice-i-cecile merged 3 commits into
bevyengine:mainfrom
MoRusty:render_phase_changes
Jul 14, 2026
Merged

Render phase changes#24980
alice-i-cecile merged 3 commits into
bevyengine:mainfrom
MoRusty:render_phase_changes

Conversation

@MoRusty

@MoRusty MoRusty commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Objective

Solution

  • in render_phase, instance count was being incremented whether or not the entity got added to the RenderBinnedMeshInstanceIndex. went with a bool because the count also needs to be changed for the gpubuffer

Testing

  • Did you test these changes? If so, how?
    ran both examples
  cargo run --example mixed_lighting --features="jpeg"
  cargo run --example pcss --features="experimental_pbr_pcss"
  • Are there any parts that need more testing? Any other example that uses the Bevy_Render crate
  • How can other people (reviewers) test your changes? Is there anything specific they need to know?
  • If relevant, what platforms did you test these changes on, and are there any important ones you can't test? N/A

@MoRusty

MoRusty commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@kfc35 made a different PR for it and closed the previous one

@kfc35 kfc35 added C-Bug An unexpected or incorrect behavior A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 13, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Jul 13, 2026
@kfc35 kfc35 added this to the 0.20 milestone Jul 13, 2026
@kfc35
kfc35 requested review from kfc35 and pcwalton July 13, 2026 19:35
@kfc35 kfc35 added the D-Straightforward Simple bug fixes and API improvements, docs, test and examples label Jul 13, 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.

Thank you for fixing this! Quick work, and nice catch!

I can confirm that all the affected examples that I found are fixed with this PR.

Comment thread crates/bevy_render/src/render_phase/mod.rs Outdated
Co-authored-by: Kevin Chen <chen.kevin.f@gmail.com>
@alice-i-cecile alice-i-cecile 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 Jul 14, 2026
@alice-i-cecile
alice-i-cecile added this pull request to the merge queue Jul 14, 2026
Merged via the queue into bevyengine:main with commit 0358688 Jul 14, 2026
40 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Jul 14, 2026
@pcwalton

Copy link
Copy Markdown
Contributor

This was not the correct fix. Binning a mesh instance that is already binned is always illegal and is going to cause problems. The right fix is to fix the circumstances that cause us to bin meshes twice in the first place, such as #24984. I know that that PR alone didn’t fix the PCSS crash, but I’m looking into why that is happening.

@MoRusty

MoRusty commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@pcwalton Understood, I was assuming the duplicate binning was related to deferred component changes on the same entity, especially in the PCSS crash path, where insert/remove operations may not be reflected immediately. I’m reading through #24984

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.

pcss, clustered_decal_maps, mixed_lighting examples panic on main

4 participants