bevy/crates/bevy_sprite/src
Rob Parrett 05c87f3c01
Fix text2d view-visibility (#10100)
# Objective

Fixes #9676
Possible alternative to #9708

`Text2dBundles` are not currently drawn because the render-world-only
entities for glyphs that are created in `extract_text2d_sprite` are not
tracked by the per-view `VisibleEntities`.

## Solution

Add an `Option<Entity>` to `ExtractedSprite` that keeps track of the
original entity that caused a "glyph entity" to be created.

Use that in `queue_sprites` if it exists when checking view visibility.

## Benchmarks

Quick benchmarks. Average FPS over 1500 frames.

| bench | before fps | after fps | diff |
|-|-|-|-|
|many_sprites|884.93|879.00|🟡 -0.7%|
|bevymark -- --benchmark --waves 100 --per-wave 1000 --mode
sprite|75.99|75.93|🟡 -0.1%|
|bevymark -- --benchmark --waves 50 --per-wave 1000 --mode
mesh2d|32.85|32.58|🟡 -0.8%|
2023-10-13 19:14:31 +00:00
..
mesh2d pbr shader cleanup (#10105) 2023-10-13 19:12:40 +00:00
render Fix text2d view-visibility (#10100) 2023-10-13 19:14:31 +00:00
bundle.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
collide_aabb.rs Update docs to reflect that the shallowest and not the deepest penetr… (#8473) 2023-04-23 19:41:21 +00:00
dynamic_texture_atlas_builder.rs Doc bevy sprite (#7858) 2023-03-03 18:14:40 +00:00
lib.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00
sprite.rs Make Anchor Copy (#9327) 2023-08-11 21:04:53 +00:00
texture_atlas_builder.rs Fix TextureAtlasBuilder padding (#10031) 2023-10-06 15:33:57 +00:00
texture_atlas.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +00:00