bevy/crates/bevy_render/src
Patrick Walton a81c8f9744
Don't unconditionally create temporary render entities for visible objects. (#16723)
PR #15756 made us create temporary render entities for all visible
objects, even if they had no render world counterpart. This regressed
our `many_cubes` time from about 3.59 ms/frame to 4.66 ms/frame.

This commit changes that behavior to use `Entity::PLACEHOLDER` instead
of creating a temporary render entity. This improves our `many_cubes`
time from 5.66 ms/frame to 3.96 ms/frame, a 43% speedup.

I tested 3D, 2D gizmos, and UI and they seem to work.

See the following graph of `many_cubes` frame time (lower is better). PR
#15756 is the one in October.

![Time (ms_frame) vs
Date(3)](https://github.com/user-attachments/assets/2c31a893-97bd-40f6-9e89-d2195a44cf40)
2024-12-10 03:31:17 +00:00
..
batching Allow holes in the MeshInputUniform buffer. (#16695) 2024-12-09 02:11:27 +00:00
camera Don't unconditionally create temporary render entities for visible objects. (#16723) 2024-12-10 03:31:17 +00:00
diagnostic Ensure Bevy's rendering byte usage is little-endian (#15750) 2024-10-08 22:43:35 +00:00
mesh Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
primitives Add .contains_aabb for Frustum (#16022) 2024-12-01 21:30:01 +00:00
render_graph Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
render_phase Use multidraw for opaque meshes when GPU culling is in use. (#16427) 2024-12-06 17:22:03 +00:00
render_resource Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
renderer Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
texture Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
view Retain RenderMeshInstance and MeshInputUniform data from frame to frame. (#16385) 2024-12-05 21:16:04 +00:00
alpha.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
color_operations.wgsl move wgsl color operations from bevy_pbr to bevy_render (#13209) 2024-05-04 10:30:23 +00:00
extract_component.rs Remove ExtractComponent::Out (#15926) 2024-10-15 23:42:35 +00:00
extract_instances.rs Type safe retained render world (#15756) 2024-10-10 18:47:04 +00:00
extract_param.rs Implement WorldQuery for MainWorld and RenderWorld components (#15745) 2024-10-13 20:58:46 +00:00
extract_resource.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
globals.rs aligning public apis of Time,Timer and Stopwatch (#15962) 2024-10-16 21:09:32 +00:00
globals.wgsl Refactor Globals and View structs into separate shaders (#7512) 2023-02-11 17:55:18 +00:00
gpu_component_array_buffer.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
gpu_readback.rs Don't reëxport bevy_image from bevy_render (#16163) 2024-11-10 06:54:38 +00:00
lib.rs cleanup bevy_render/lib.rs (#16481) 2024-11-22 22:32:04 +00:00
maths.wgsl add tonemapping LUT bindings for sprite and mesh2d pipelines (#13262) 2024-05-28 12:09:26 +00:00
pipelined_rendering.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
render_asset.rs Deny derive_more error feature and replace it with thiserror (#16684) 2024-12-06 17:03:55 +00:00
settings.rs cleanup bevy_render/lib.rs (#16481) 2024-11-22 22:32:04 +00:00
spatial_bundle.rs Deprecate SpatialBundle (#15830) 2024-10-13 17:28:22 +00:00
storage.rs Add a bindless mode to AsBindGroup. (#16368) 2024-12-03 18:00:34 +00:00
sync_component.rs Synchronize removed components with the render world (#15582) 2024-10-08 22:23:17 +00:00
sync_world.rs Rename trigger.entity() to trigger.target() (#16716) 2024-12-08 21:55:09 +00:00