bevy/crates/bevy_render/src
MiniaczQ acea4e7e6f
Better warnings about invalid parameters (#15500)
# Objective

System param validation warnings should be configurable and default to
"warn once" (per system).

Fixes: #15391

## Solution

`SystemMeta` is given a new `ParamWarnPolicy` field.
The policy decides whether warnings will be emitted by each system param
when it fails validation.
The policy is updated by the system after param validation fails.

Example warning:
```
2024-09-30T18:10:04.740749Z  WARN bevy_ecs::system::function_system: System fallible_params::do_nothing_fail_validation will not run because it requested inaccessible system parameter Single<(), (With<Player>, With<Enemy>)>
```

Currently, only the first invalid parameter is displayed.

Warnings can be disabled on function systems using
`.param_never_warn()`.
(there is also `.with_param_warn_policy(policy)`)

## Testing

Ran `fallible_params` example.

---------

Co-authored-by: SpecificProtagonist <vincentjunge@posteo.net>
2024-10-03 13:16:55 +00:00
..
batching Remove remnant EntityHash and related types from bevy_utils (#15039) 2024-09-09 15:24:17 +00:00
camera Revert "Have EntityCommands methods consume self for easier chaining" (#15523) 2024-10-02 12:47:26 +00:00
diagnostic Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
mesh Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +00:00
primitives Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +00:00
render_graph Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
render_phase Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
render_resource Cleanup unneeded lifetimes in bevy_asset (#15546) 2024-09-30 21:54:59 +00:00
renderer Remove render_resource_wrapper (#15441) 2024-09-30 17:37:07 +00:00
texture Cleanup unneeded lifetimes in bevy_asset (#15546) 2024-09-30 21:54:59 +00:00
view Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +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 The Cooler 'Retain Rendering World' (#15320) 2024-09-30 18:51:43 +00:00
extract_instances.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
extract_param.rs Better warnings about invalid parameters (#15500) 2024-10-03 13:16:55 +00:00
extract_resource.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
globals.rs Refactor App and SubApp internals for better separation (#9202) 2024-03-31 03:16:10 +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 Gpu readback (#15419) 2024-09-30 17:28:55 +00:00
lib.rs Migrate meshes and materials to required components (#15524) 2024-10-01 21:33:17 +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 The Cooler 'Retain Rendering World' (#15320) 2024-09-30 18:51:43 +00:00
render_asset.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
settings.rs Add core and alloc over std Lints (#15281) 2024-09-27 00:59:59 +00:00
spatial_bundle.rs Clearer spatial bundle pub const docs (#14293) 2024-07-15 16:03:09 +00:00
storage.rs Simpler lint fixes: makes ci lints work but disables a lint for now (#15376) 2024-09-24 11:42:59 +00:00
world_sync.rs The Cooler 'Retain Rendering World' (#15320) 2024-09-30 18:51:43 +00:00