bevy/crates/bevy_render/src
Patrick Walton e67d63aa79
Refactor the render instance logic in #9903 so that it's easier for other components to adopt. (#10002)
# Objective

Currently, the only way for custom components that participate in
rendering to opt into the higher-performance extraction method in #9903
is to implement the `RenderInstances` data structure and the extraction
logic manually. This is inconvenient compared to the `ExtractComponent`
API.

## Solution

This commit creates a new `RenderInstance` trait that mirrors the
existing `ExtractComponent` method but uses the higher-performance
approach that #9903 uses. Additionally, `RenderInstance` is more
flexible than `ExtractComponent`, because it can extract multiple
components at once. This makes high-performance rendering components
essentially as easy to write as the existing ones based on component
extraction.

---

## Changelog

### Added

A new `RenderInstance` trait is available mirroring `ExtractComponent`,
but using a higher-performance method to extract one or more components
to the render world. If you have custom components that rendering takes
into account, you may consider migration from `ExtractComponent` to
`RenderInstance` for higher performance.
2023-10-08 10:34:44 +00:00
..
batching Use EntityHashMap<Entity, T> for render world entity storage for better performance (#9903) 2023-09-27 08:28:28 +00:00
camera Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
color Remove useless single tuples and trailing commas (#9720) 2023-09-08 21:46:54 +00:00
mesh Import the second UV map if present in glTF files. (#9992) 2023-10-02 21:07:03 +00:00
primitives Add a method to compute a bounding box enclosing a set of points (#9630) 2023-08-31 01:33:13 +00:00
render_graph Fix the clippy::explicit_iter_loop lint (#9834) 2023-09-19 03:35:22 +00:00
render_phase Replaced parking_lot with std::sync (#9545) 2023-10-02 12:44:34 +00:00
render_resource Removed anyhow (#10003) 2023-10-06 07:20:13 +00:00
renderer ignore time channel error (#9981) 2023-10-01 07:55:17 +00:00
texture Removed anyhow (#10003) 2023-10-06 07:20:13 +00:00
view Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
extract_component.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
extract_param.rs Improve doc formatting. (#9840) 2023-09-18 19:43:56 +00:00
extract_resource.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
globals.rs Bevy Asset V2 (#8624) 2023-09-07 02:07:27 +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 Reorder render sets, refactor bevy_sprite to take advantage (#9236) 2023-08-27 14:33:49 +00:00
instance_index.wgsl Work around naga/wgpu WGSL instance_index -> GLSL gl_InstanceID bug on WebGL2 (#9383) 2023-08-09 18:38:45 +00:00
lib.rs Refactor the render instance logic in #9903 so that it's easier for other components to adopt. (#10002) 2023-10-08 10:34:44 +00:00
maths.wgsl Use instancing for sprites (#9597) 2023-09-02 18:03:19 +00:00
pipelined_rendering.rs Fix CI for Rust 1.72 (#9562) 2023-08-25 12:34:24 +00:00
render_asset.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
render_instances.rs Refactor the render instance logic in #9903 so that it's easier for other components to adopt. (#10002) 2023-10-08 10:34:44 +00:00
settings.rs Updates for rust 1.73 (#10035) 2023-10-06 00:31:10 +00:00
spatial_bundle.rs Improve SpatialBundle docs (#9673) 2023-09-02 23:44:12 +00:00