bevy/crates/bevy_render/src
Thomas Wilgenbus 4ae6a66481
Allow optional extraction of resources from the main world (#10109)
# Objective

From my understanding, although resources are not meant to be created
and removed at every frame, they are still meant to be created
dynamically during the lifetime of the App.
But because the extract_resource API does not allow optional resources
from the main world, it's impossible to use resources in the render
phase that were not created before the render sub-app itself.

## Solution

Because the ECS engine already allows for system parameters to be
`Option<Res>`, it just had to be added.

---

## Changelog

- Changed
    - `extract_resource` now takes an optional main world resource

- Fixed
- `ExtractResourcePlugin` doesn't cause panics anymore if the resource
is not already inserted
2023-10-14 16:07:49 +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 Add consuming builder methods for more ergonomic Mesh creation (#10056) 2023-10-09 19:47:41 +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 Deferred Renderer (#9258) 2023-10-12 22:10:38 +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_instances.rs chore: Renamed RenderInstance trait to ExtractInstance (#10065) 2023-10-13 17:06:53 +00:00
extract_param.rs Improve doc formatting. (#9840) 2023-09-18 19:43:56 +00:00
extract_resource.rs Allow optional extraction of resources from the main world (#10109) 2023-10-14 16:07:49 +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 chore: Renamed RenderInstance trait to ExtractInstance (#10065) 2023-10-13 17:06:53 +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
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