bevy/crates/bevy_render/src
Chris Russell d0550f58ae
Remove 's lifetime from WorldQuery::Fetch (#19720)
# Objective

Unblock #18162.

#15396 added the `'s` lifetime to `QueryData::Item` to make it possible
for query items to borrow from the state. The state isn't passed
directly to `QueryData::fetch()`, so it also added the `'s` lifetime to
`WorldQuery::Fetch` so that we can pass the borrows through there.

Unfortunately, having `WorldQuery::Fetch` borrow from the state makes it
impossible to have owned state, because we store the state and the
`Fetch` in the same `struct` during iteration.

## Solution

Undo the change to add the `'s` lifetime to `WorldQuery::Fetch`.

Instead, add a `&'s Self::State` parameter to `QueryData::fetch()` and
`QueryFilter::filter_fetch()` so that borrows from the state can be
passed directly to query items.

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Emerson Coskey <emerson@coskey.dev>
2025-06-19 00:58:21 +00:00
..
batching clippy: expect large variants and other small fixes (#19222) 2025-05-15 22:29:59 +00:00
camera rename GlobalTransform::compute_matrix to to_matrix (#19643) 2025-06-17 18:37:26 +00:00
diagnostic refactor(render): move WgpuWrapper into bevy_utils (#19303) 2025-05-27 03:43:49 +00:00
experimental Remove Shader weak_handles from bevy_render. (#19362) 2025-05-26 20:20:25 +00:00
mesh Add extra buffer usages field to MeshAllocator (#19546) 2025-06-09 20:03:57 +00:00
primitives reexport entity set collections in entity module (#18413) 2025-03-30 03:51:14 +00:00
render_graph Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
render_phase Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
render_resource Fixing running ci locally in MacOS (#19619) 2025-06-13 14:51:28 +00:00
renderer Initial raytraced lighting progress (bevy_solari) (#19058) 2025-06-12 21:26:10 +00:00
texture Optional explicit compressed image format support (#19190) 2025-05-26 18:00:33 +00:00
view rename GlobalTransform::compute_matrix to to_matrix (#19643) 2025-06-17 18:37:26 +00:00
alpha.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
bindless.wgsl Use global binding arrays for bindless resources. (#17898) 2025-02-21 05:55:36 +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 Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
extract_instances.rs Let query items borrow from query state to avoid needing to clone (#15396) 2025-06-16 21:05:41 +00:00
extract_param.rs Stop storing access for all systems (#19477) 2025-06-13 17:56:09 +00:00
extract_resource.rs Fix "Unrecognized Option" error when using Criterion-specific arguments in benchmarks (#17222) 2025-01-08 00:09:31 +00:00
globals.rs Remove Shader weak_handles from bevy_render. (#19362) 2025-05-26 20:20:25 +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 Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
gpu_readback.rs Event Split: Event, EntityEvent, and BufferedEvent (#19647) 2025-06-15 16:46:34 +00:00
lib.rs bevyengine.org -> bevy.org (#19503) 2025-06-05 23:09:28 +00:00
maths.wgsl Atmosphere LUT parameterization improvements (#17555) 2025-02-03 21:52:11 +00:00
pipelined_rendering.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
render_asset.rs Adopt consistent FooSystems naming convention for system sets (#18900) 2025-05-06 15:18:03 +00:00
settings.rs clippy: expect large variants and other small fixes (#19222) 2025-05-15 22:29:59 +00:00
storage.rs bevy_reflect: Add clone registrations project-wide (#18307) 2025-03-17 18:32:35 +00:00
sync_component.rs Refactored ComponentHook Parameters into HookContext (#17503) 2025-01-23 02:45:24 +00:00
sync_world.rs Remove 's lifetime from WorldQuery::Fetch (#19720) 2025-06-19 00:58:21 +00:00