Skip to content

Comments

Fix 2d specialization w/ change lists.#23083

Open
tychedelia wants to merge 1 commit intobevyengine:mainfrom
tychedelia:22966/fix-2d-specialization
Open

Fix 2d specialization w/ change lists.#23083
tychedelia wants to merge 1 commit intobevyengine:mainfrom
tychedelia:22966/fix-2d-specialization

Conversation

@tychedelia
Copy link
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
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 S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

3 participants