Skip to content

Fix 2d specialization w/ change lists.#23083

Merged
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
tychedelia:22966/fix-2d-specialization
Feb 22, 2026
Merged

Fix 2d specialization w/ change lists.#23083
alice-i-cecile merged 1 commit into
bevyengine:mainfrom
tychedelia:22966/fix-2d-specialization

Conversation

@tychedelia

Copy link
Copy Markdown
Member

Some fixes for 2d post #22966.

This is complicated because, unlike 3d, 2d material systems are generic over their material and not type erased. Which means we have to be defensive against all the weird scenarios that can happen when different material systems race against each other.

I am not confident this is correct. The ultimate solution is just to get rid of all these bespoke 2d systems.

The main fixes are:

  • material_bind_group_id is no longer reset to default every frame. extract_mesh2d was setting material_bind_group_id on every extraction. Previously this was overwritten later during queuing every frame, but with dirty tracking, entities aren't re-queued every frame so the default sticks.
  • prepare_for_new_frame moved to a non-generic system.
  • More careful about not adding wrong material type entities to the pending queue where they'll churn forever without getting specialized.
  • Dequeue no longer cross-type stomps. When a view is dirty, we were returning all visible entities, which was problematic in the context of multiple materials.

@kfc35 kfc35 added A-Rendering Drawing game state to the screen S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 21, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in Rendering Feb 21, 2026
@mockersf mockersf added this to the 0.19 milestone Feb 21, 2026

@pcwalton pcwalton 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.

Thanks, I hate it :)

We really ought to type-erase 2D materials, or just unify them with 3D.

@tychedelia

Copy link
Copy Markdown
Member Author

We really ought to type-erase 2D materials, or just unify them with 3D.

That's the goal! Working on it now.

@atlv24 atlv24 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.

oh my

@atlv24 atlv24 added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it C-Bug An unexpected or incorrect behavior P-Regression Functionality that used to work but no longer does. Add a test for this! and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Feb 22, 2026
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Feb 22, 2026
Merged via the queue into bevyengine:main with commit ea0d43e Feb 22, 2026
67 of 69 checks passed
@github-project-automation github-project-automation Bot moved this from Needs SME Triage to Done in Rendering Feb 22, 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 P-Regression Functionality that used to work but no longer does. Add a test for this! 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.

6 participants