Skip to content

Commit feb0dc6

Browse files
authored
Fix: "The build mesh uniforms pipeline wasn't ready” warning now fires only once (#22398)
# Objective - Fixes #22358 ## Solution - Use `warn_once` for the log message (and add `bevy_log` as a dependency for `bevy_pbr`) ## Testing I added `main.rs` in the reproduction repo https://github.com/logankaser/bevy-uniforms-pipeline-repro/blob/main/src/main.rs as an example file in the main `bevy` repo and ran it with `bevy run --example repro --features=bevy_camera,bevy_core_pipeline,bevy_log,bevy_pbr,bevy_render,bevy_window,bevy_winit,webgpu web --open`. I opened up the app in Chrome and verified in the console log that the warning only fires once <details> <summary>screenshots of console logs</summary> In google chrome beforehand, you see the spam in the console: <img width="705" height="285" alt="Screenshot 2026-01-05 at 10 04 57 PM" src="https://github.com/user-attachments/assets/7fe4cb1c-2df3-4d3b-a80d-4dfdaf2efb68" /> After the change, it just warns once: <img width="728" height="62" alt="Screenshot 2026-01-06 at 12 06 14 AM" src="https://github.com/user-attachments/assets/c269f10e-1a7f-4daf-a8c8-dc812895eb68" /> </details>
1 parent 1384bcb commit feb0dc6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

crates/bevy_pbr/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ bevy_derive = { path = "../bevy_derive", version = "0.18.0-dev" }
4242
bevy_diagnostic = { path = "../bevy_diagnostic", version = "0.18.0-dev" }
4343
bevy_ecs = { path = "../bevy_ecs", version = "0.18.0-dev" }
4444
bevy_light = { path = "../bevy_light", version = "0.18.0-dev" }
45+
bevy_log = { path = "../bevy_log", version = "0.18.0-dev" }
4546
bevy_image = { path = "../bevy_image", version = "0.18.0-dev" }
4647
bevy_mesh = { path = "../bevy_mesh", version = "0.18.0-dev", features = [
4748
"morph",

crates/bevy_pbr/src/render/gpu_preprocess.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use bevy_ecs::{
2626
system::{lifetimeless::Read, Commands, Query, Res, ResMut},
2727
world::{FromWorld, World},
2828
};
29+
use bevy_log::warn_once;
2930
use bevy_render::{
3031
batching::gpu_preprocessing::{
3132
BatchedInstanceBuffers, GpuOcclusionCullingWorkItemBuffers, GpuPreprocessingMode,
@@ -838,7 +839,7 @@ impl Node for LateGpuPreprocessNode {
838839

839840
// Fetch the pipeline.
840841
let Some(preprocess_pipeline_id) = maybe_pipeline_id else {
841-
warn!("The build mesh uniforms pipeline wasn't ready");
842+
warn_once!("The build mesh uniforms pipeline wasn't ready");
842843
return Ok(());
843844
};
844845

0 commit comments

Comments
 (0)