Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/bevy_log/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub mod prelude {

pub use bevy_utils::once;
pub use tracing::{
self, debug, debug_span, error, error_span, info, info_span, trace, trace_span, warn,
self, debug, debug_span, error, error_span, event, info, info_span, trace, trace_span, warn,
warn_span, Level,
};
pub use tracing_subscriber;
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ bevy_encase_derive = { path = "../bevy_encase_derive", version = "0.19.0-dev" }
bevy_math = { path = "../bevy_math", version = "0.19.0-dev" }
bevy_material = { path = "../bevy_material", version = "0.19.0-dev" }
bevy_reflect = { path = "../bevy_reflect", version = "0.19.0-dev" }
bevy_log = { path = "../bevy_log", version = "0.19.0-dev" }
bevy_material_macros = { path = "../bevy_material/macros", version = "0.19.0-dev" }
bevy_render_macros = { path = "../bevy_render/macros", version = "0.19.0-dev" }
bevy_time = { path = "../bevy_time", version = "0.19.0-dev" }
Expand Down Expand Up @@ -115,7 +116,6 @@ nonmax = "0.5"
smallvec = { version = "1", default-features = false, features = ["const_new"] }
offset-allocator = "0.2"
variadics_please = "1.1"
tracing = { version = "0.1", default-features = false, features = ["std"] }
tracy-client = { version = "0.18.3", optional = true }
indexmap = { version = "2" }
fixedbitset = { version = "0.5" }
Expand Down
26 changes: 13 additions & 13 deletions crates/bevy_render/src/batching/gpu_preprocessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use bevy_ecs::{
world::{FromWorld, World},
};
use bevy_encase_derive::ShaderType;
use bevy_log::{error, info};
use bevy_math::UVec4;
use bevy_platform::collections::{hash_map::Entry, HashMap, HashSet};
use bevy_tasks::ComputeTaskPool;
Expand All @@ -21,7 +22,6 @@ use bytemuck::{Pod, Zeroable};
use encase::{internal::WriteInto, ShaderSize};
use indexmap::IndexMap;
use nonmax::NonMaxU32;
use tracing::{error, info};
use wgpu::{BindingResource, BufferUsages, DownlevelFlags, Features};

use crate::{
Expand Down Expand Up @@ -2023,13 +2023,13 @@ pub fn write_batched_instance_buffers<GFBD>(

ComputeTaskPool::get().scope(|scope| {
scope.spawn(async {
let _span = tracing::info_span!("write_current_input_buffers").entered();
let _span = bevy_log::info_span!("write_current_input_buffers").entered();
current_input_buffer
.buffer
.write_buffer(render_device, render_queue);
});
scope.spawn(async {
let _span = tracing::info_span!("write_previous_input_buffers").entered();
let _span = bevy_log::info_span!("write_previous_input_buffers").entered();
previous_input_buffer
.buffer
.write_buffer(render_device, render_queue);
Expand All @@ -2044,7 +2044,7 @@ pub fn write_batched_instance_buffers<GFBD>(
} = *phase_instance_buffers;

scope.spawn(async {
let _span = tracing::info_span!("write_phase_instance_buffers").entered();
let _span = bevy_log::info_span!("write_phase_instance_buffers").entered();
data_buffer.write_buffer(render_device);
late_indexed_indirect_parameters_buffer.write_buffer(render_device, render_queue);
late_non_indexed_indirect_parameters_buffer
Expand All @@ -2053,7 +2053,7 @@ pub fn write_batched_instance_buffers<GFBD>(

for phase_work_item_buffers in work_item_buffers.values_mut() {
scope.spawn(async {
let _span = tracing::info_span!("write_work_item_buffers").entered();
let _span = bevy_log::info_span!("write_work_item_buffers").entered();
match *phase_work_item_buffers {
PreprocessWorkItemBuffers::Direct(ref mut buffer_vec) => {
buffer_vec.write_buffer(render_device, render_queue);
Expand Down Expand Up @@ -2106,59 +2106,59 @@ pub fn write_indirect_parameters_buffers(
ComputeTaskPool::get().scope(|scope| {
for phase_indirect_parameters_buffers in indirect_parameters_buffers.values_mut() {
scope.spawn(async {
let _span = tracing::info_span!("indexed_data").entered();
let _span = bevy_log::info_span!("indexed_data").entered();
phase_indirect_parameters_buffers
.indexed
.data
.write_buffer(render_device);
});
scope.spawn(async {
let _span = tracing::info_span!("non_indexed_data").entered();
let _span = bevy_log::info_span!("non_indexed_data").entered();
phase_indirect_parameters_buffers
.non_indexed
.data
.write_buffer(render_device);
});

scope.spawn(async {
let _span = tracing::info_span!("indexed_cpu_metadata").entered();
let _span = bevy_log::info_span!("indexed_cpu_metadata").entered();
phase_indirect_parameters_buffers
.indexed
.cpu_metadata
.write_buffer(render_device, render_queue);
});
scope.spawn(async {
let _span = tracing::info_span!("non_indexed_cpu_metadata").entered();
let _span = bevy_log::info_span!("non_indexed_cpu_metadata").entered();
phase_indirect_parameters_buffers
.non_indexed
.cpu_metadata
.write_buffer(render_device, render_queue);
});

scope.spawn(async {
let _span = tracing::info_span!("non_indexed_gpu_metadata").entered();
let _span = bevy_log::info_span!("non_indexed_gpu_metadata").entered();
phase_indirect_parameters_buffers
.non_indexed
.gpu_metadata
.write_buffer(render_device);
});
scope.spawn(async {
let _span = tracing::info_span!("indexed_gpu_metadata").entered();
let _span = bevy_log::info_span!("indexed_gpu_metadata").entered();
phase_indirect_parameters_buffers
.indexed
.gpu_metadata
.write_buffer(render_device);
});

scope.spawn(async {
let _span = tracing::info_span!("indexed_batch_sets").entered();
let _span = bevy_log::info_span!("indexed_batch_sets").entered();
phase_indirect_parameters_buffers
.indexed
.batch_sets
.write_buffer(render_device, render_queue);
});
scope.spawn(async {
let _span = tracing::info_span!("non_indexed_batch_sets").entered();
let _span = bevy_log::info_span!("non_indexed_batch_sets").entered();
phase_indirect_parameters_buffers
.non_indexed
.batch_sets
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/batching/no_gpu_preprocessing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use bevy_derive::{Deref, DerefMut};
use bevy_ecs::entity::Entity;
use bevy_ecs::resource::Resource;
use bevy_ecs::system::{Res, ResMut, StaticSystemParam};
use bevy_log::error;
use smallvec::{smallvec, SmallVec};
use tracing::error;
use wgpu::{BindingResource, Limits};

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/camera.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ use bevy_ecs::{
world::DeferredWorld,
};
use bevy_image::Image;
use bevy_log::warn;
use bevy_math::{uvec2, vec2, Mat4, URect, UVec2, UVec4, Vec2};
use bevy_platform::collections::{HashMap, HashSet};
use bevy_reflect::prelude::*;
use bevy_transform::components::GlobalTransform;
use bevy_window::{PrimaryWindow, Window, WindowCreated, WindowResized, WindowScaleFactorChanged};
use tracing::warn;
use wgpu::TextureFormat;

#[derive(Default)]
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/diagnostic/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl FrameData {
let is_mapped = self.is_mapped.clone();
read_buffer.slice(..).map_async(MapMode::Read, move |res| {
if let Err(e) = res {
tracing::warn!("Failed to download render statistics buffer: {e}");
bevy_log::warn!("Failed to download render statistics buffer: {e}");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/erased_render_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ use bevy_ecs::{
system::{ScheduleSystem, StaticSystemParam, SystemParam, SystemParamItem, SystemState},
world::{FromWorld, Mut},
};
use bevy_log::{debug, error};
use bevy_platform::collections::{HashMap, HashSet};
use bevy_render::render_asset::RenderAssetBytesPerFrameLimiter;
use core::marker::PhantomData;
use thiserror::Error;
use tracing::{debug, error};

#[derive(Debug, Error)]
pub enum PrepareAssetError<E: Send + Sync + 'static> {
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_render/src/extract_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl<R: ExtractResource> Plugin for ExtractResourcePlugin<R> {
if let Some(render_app) = app.get_sub_app_mut(RenderApp) {
render_app.add_systems(ExtractSchedule, extract_resource::<R>);
} else {
once!(tracing::error!(
once!(bevy_log::error!(
"Render app did not exist when trying to add `extract_resource` for <{}>.",
core::any::type_name::<R>()
));
Expand All @@ -57,7 +57,7 @@ pub fn extract_resource<R: ExtractResource>(
} else {
#[cfg(debug_assertions)]
if !main_resource.is_added() {
once!(tracing::warn!(
once!(bevy_log::warn!(
"Removing resource {} from render world not expected, adding using `Commands`.
This may decrease performance",
core::any::type_name::<R>()
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/gpu_readback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ use bevy_ecs::{
system::{Query, Res},
};
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_log::warn;
use bevy_platform::collections::HashMap;
use bevy_reflect::Reflect;
use bevy_render_macros::ExtractComponent;
use encase::internal::ReadFrom;
use encase::private::Reader;
use encase::ShaderType;
use tracing::warn;

/// A plugin that enables reading back gpu buffers and textures to the cpu.
pub struct GpuReadbackPlugin {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ unsafe fn initialize_render_app(app: &mut App) {

{
#[cfg(feature = "trace")]
let _stage_span = tracing::info_span!("entity_sync").entered();
let _stage_span = bevy_log::info_span!("entity_sync").entered();
entity_sync_system(main_world, render_world);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/mesh/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ use bevy_ecs::{
system::{Res, ResMut},
world::{FromWorld, World},
};
use bevy_log::error;
use bevy_platform::collections::{hash_map::Entry, HashMap, HashSet};
use bevy_utils::default;
use offset_allocator::{Allocation, Allocator};
use tracing::error;
use wgpu::{
BufferDescriptor, BufferSize, BufferUsages, CommandEncoderDescriptor, DownlevelFlags,
COPY_BUFFER_ALIGNMENT,
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_render/src/pipelined_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl Plugin for PipelinedRenderingPlugin {

std::thread::spawn(move || {
#[cfg(feature = "trace")]
let _span = tracing::info_span!("render thread").entered();
let _span = bevy_log::info_span!("render thread").entered();

let compute_task_pool = ComputeTaskPool::get();
loop {
Expand All @@ -164,7 +164,7 @@ impl Plugin for PipelinedRenderingPlugin {

{
#[cfg(feature = "trace")]
let _sub_app_span = tracing::info_span!("sub app", name = ?RenderApp).entered();
let _sub_app_span = bevy_log::info_span!("sub app", name = ?RenderApp).entered();
render_app.update();
}

Expand All @@ -173,7 +173,7 @@ impl Plugin for PipelinedRenderingPlugin {
}
}

tracing::debug!("exiting pipelined rendering thread");
bevy_log::debug!("exiting pipelined rendering thread");
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ use bevy_ecs::{
system::{ScheduleSystem, StaticSystemParam, SystemParam, SystemParamItem, SystemState},
world::{FromWorld, Mut},
};
use bevy_log::{debug, error};
use bevy_platform::collections::{HashMap, HashSet};
use core::marker::PhantomData;
use core::sync::atomic::{AtomicUsize, Ordering};
use thiserror::Error;
use tracing::{debug, error};

#[derive(Debug, Error)]
pub enum PrepareAssetError<E: Send + Sync + 'static> {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_graph/app.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use bevy_app::{App, SubApp};
use bevy_ecs::world::{FromWorld, World};
use tracing::warn;
use bevy_log::warn;

use super::{IntoRenderNodeArray, Node, RenderGraph, RenderLabel, RenderSubGraph};

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_graph/camera_driver_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl Node for CameraDriverNode {
};

#[cfg(feature = "trace")]
let _span = tracing::info_span!("no_camera_clear_pass").entered();
let _span = bevy_log::info_span!("no_camera_clear_pass").entered();
let pass_descriptor = RenderPassDescriptor {
label: Some("no_camera_clear_pass"),
color_attachments: &[Some(RenderPassColorAttachment {
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_phase/draw_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use core::ops::Range;
use wgpu::{IndexFormat, QuerySet, RenderPass};

#[cfg(feature = "detailed_trace")]
use tracing::trace;
use bevy_log::trace;

type BufferSliceKey = (BufferId, wgpu::BufferAddress, wgpu::BufferSize);

Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_phase/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ use bevy_ecs::{
prelude::*,
system::{lifetimeless::SRes, SystemParamItem},
};
use bevy_log::warn;
pub use bevy_material::labels::DrawFunctionId;
pub use bevy_material_macros::DrawFunctionLabel;
pub use bevy_material_macros::ShaderLabel;
use bevy_render::renderer::RenderAdapterInfo;
use core::{fmt::Debug, hash::Hash, iter, marker::PhantomData, ops::Range, slice::SliceIndex};
use smallvec::SmallVec;
use tracing::warn;

/// Stores the rendering instructions for a single phase that uses bins in all
/// views.
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_resource/pipeline_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use bevy_ecs::{
resource::Resource,
system::{Res, ResMut},
};
use bevy_log::error;
use bevy_platform::collections::{HashMap, HashSet};
use bevy_shader::{
CachedPipelineId, Shader, ShaderCache, ShaderCacheError, ShaderCacheSource, ShaderDefVal,
Expand All @@ -24,7 +25,6 @@ use bevy_tasks::Task;
use bevy_utils::default;
use core::{future::Future, mem};
use std::sync::{Mutex, PoisonError};
use tracing::error;
use wgpu::{PipelineCompilationOptions, VertexBufferLayout as RawVertexBufferLayout};

/// A pipeline defining the data layout and shader logic for a specific GPU task.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy_material::descriptor::{

use crate::render_resource::PipelineCache;
use bevy_ecs::resource::Resource;
use bevy_log::error;
use bevy_material::specialize::SpecializedMeshPipelineError;
use bevy_mesh::{MeshVertexBufferLayoutRef, VertexBufferLayout};
use bevy_platform::{
Expand All @@ -16,7 +17,6 @@ use bevy_platform::{
};
use bevy_utils::default;
use core::hash::Hash;
use tracing::error;

/// A trait that allows constructing different variants of a render pipeline from a key.
///
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_render/src/render_resource/specializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use bevy_material::descriptor::{

use super::{ComputePipeline, PipelineCache, RenderPipeline};
use bevy_ecs::error::BevyError;
use bevy_log::error;
use bevy_platform::{
collections::{
hash_map::{Entry, VacantEntry},
Expand All @@ -13,7 +14,6 @@ use bevy_platform::{
hash::FixedHasher,
};
use core::{hash::Hash, marker::PhantomData};
use tracing::error;
use variadics_please::all_tuples;

pub use bevy_render_macros::{Specializer, SpecializerKey};
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_render/src/renderer/graph_runner.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bevy_ecs::{prelude::Entity, world::World};
use bevy_platform::collections::HashMap;
#[cfg(feature = "trace")]
use tracing::info_span;
use bevy_log::info_span;
use bevy_platform::collections::HashMap;

use alloc::{borrow::Cow, collections::VecDeque};
use smallvec::{smallvec, SmallVec};
Expand Down
Loading
Loading