bevy/crates/bevy_render/src
James Liu 389df18343 Change check_visibility to use thread-local queues instead of a channel (#4663)
# Objective
Further speed up visibility checking by removing the main sources of contention for the system.

## Solution
 - ~~Make `ComputedVisibility` a resource wrapping a `FixedBitset`.~~
 - ~~Remove `ComputedVisibility` as a component.~~

~~This adds a one-bit overhead to every entity in the app world. For a game with 100,000 entities, this is 12.5KB of memory. This is still small enough to fit entirely in most L1 caches. Also removes the need for a per-Entity change detection tick. This reduces the memory footprint of ComputedVisibility 72x.~~

~~The decreased memory usage and less fragmented memory locality should provide significant performance benefits.~~

~~Clearing visible entities should be significantly faster than before:~~
 
 - ~~Setting one `u32` to 0 clears 32 entities per cycle.~~
 - ~~No archetype fragmentation to contend with.~~
 - ~~Change detection is applied to the resource, so there is no per-Entity update tick requirement.~~

~~The side benefit of this design is that it removes one more "computed component" from userspace.  Though accessing the values within it are now less ergonomic.~~

This PR changes `crossbeam_channel` in `check_visibility` to use a `Local<ThreadLocal<Cell<Vec<Entity>>>` to mark down visible entities instead.

Co-Authored-By: TheRawMeatball <therawmeatball@gmail.com>
Co-Authored-By: Aevyrie <aevyrie@gmail.com>
2022-06-21 18:10:27 +00:00
..
camera bevy_reflect: put serialize into external ReflectSerialize type (#4782) 2022-06-20 17:18:58 +00:00
color bevy_reflect: put serialize into external ReflectSerialize type (#4782) 2022-06-20 17:18:58 +00:00
mesh bevy_render: Add attributes and attributes_mut methods to Mesh. (#3927) 2022-06-15 06:29:52 +00:00
primitives Faster assign lights to clusters (#4345) 2022-04-15 02:53:20 +00:00
render_graph Camera Driven Rendering (#4745) 2022-06-02 00:12:17 +00:00
render_phase Camera Driven Viewports (#4898) 2022-06-05 00:27:49 +00:00
render_resource Fix wasm examples (#4967) 2022-06-11 20:10:13 +00:00
renderer diagnostics: meaningful error when graph node has wrong number of inputs (#4924) 2022-06-06 15:47:52 +00:00
texture bevy_render: Fix KTX2 UASTC format mapping (#4569) 2022-06-17 00:14:02 +00:00
view Change check_visibility to use thread-local queues instead of a channel (#4663) 2022-06-21 18:10:27 +00:00
extract_component.rs ExtractResourcePlugin (#3745) 2022-05-30 18:36:03 +00:00
extract_resource.rs ExtractResourcePlugin (#3745) 2022-05-30 18:36:03 +00:00
lib.rs Change default Image FilterMode to Linear (#4465) 2022-06-11 09:13:37 +00:00
render_asset.rs Clippy improvements (#4665) 2022-05-31 01:38:07 +00:00
settings.rs bevy_render: Use RenderDevice to get limits/features and expose AdapterInfo (#3931) 2022-02-16 21:17:37 +00:00