-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!
Milestone
Description
Bevy version and features
94bb6e1 w/ default features.
What I did
I made a basic bevy app with default plugins and ran it.
What went wrong
I witnessed unbounded memory growth in my task manager and then proceeded to debug bevy using the following steps:
valgrind --tool=massif --time-unit=ms target/debug/my_appmassif-visualizer $MY_MASSIF_FILE- Found that process_queue() in
crates/bevy_render/src/render_resource/pipeline_cache.rswas processing pipelines without me doing anything. - I proceeded to use lldb-dap to trace the calls from
process_queue()toqueue_atmosphere_probe_pipelines.
In crates/bevy_pbr/src/atmosphere/environment.rs:
pub fn queue_atmosphere_probe_pipelines(
pipeline_cache: Res<PipelineCache>,
layouts: Res<AtmosphereProbeLayouts>,
asset_server: Res<AssetServer>,
mut commands: Commands,
) {
let environment = pipeline_cache.queue_compute_pipeline(ComputePipelineDescriptor {
label: Some("environment_pipeline".into()),
layout: vec![layouts.environment.clone()],
shader: load_embedded_asset!(asset_server.as_ref(), "environment.wgsl"),
..default()
});
commands.insert_resource(AtmosphereProbePipelines { environment });
}This function is getting called in the Render schedule in the Queue phase.
In crates/bevy_pbr/src/atmosphere/mod.rs:
.add_systems(
Render,
(
configure_camera_depth_usages.in_set(RenderSystems::ManageViews),
queue_render_sky_pipelines.in_set(RenderSystems::Queue),
prepare_atmosphere_textures.in_set(RenderSystems::PrepareResources),
prepare_probe_textures
.in_set(RenderSystems::PrepareResources)
.after(prepare_atmosphere_textures),
prepare_atmosphere_probe_bind_groups.in_set(RenderSystems::PrepareBindGroups),
queue_atmosphere_probe_pipelines // Problematic line here
.in_set(RenderSystems::Queue)
.after(init_atmosphere_probe_layout),
prepare_atmosphere_transforms.in_set(RenderSystems::PrepareResources),
prepare_atmosphere_bind_groups.in_set(RenderSystems::PrepareBindGroups),
),
)I'm not really familiar with this code, so I don't really know how to fix it, but here's an issue so somebody who knows how to can.
I also saw some other suspicious calls in massif, but one step at a time.
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!This issue is ready for an implementation PR. Go for it!