-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
a lot of new buffers created all the time after #599 #764
Copy link
Copy link
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 times
Description
Bevy version
current master (4645da3 or later)
Operating system & version
Ubuntu 20.04
What you did
Apply this patch to print a line on stdout when new buffer is created:
diff --git a/crates/bevy_wgpu/src/renderer/wgpu_render_resource_context.rs b/crates/bevy_wgpu/src/renderer/wgpu_render_resource_context.rs
index ab5048da..2e3df8e6 100644
--- a/crates/bevy_wgpu/src/renderer/wgpu_render_resource_context.rs
+++ b/crates/bevy_wgpu/src/renderer/wgpu_render_resource_context.rs
@@ -185,6 +185,7 @@ impl RenderResourceContext for WgpuRenderResourceContext {
}
fn create_buffer(&self, buffer_info: BufferInfo) -> BufferId {
+ println!("create_buffer");
// TODO: consider moving this below "create" for efficiency
let mut buffer_infos = self.resources.buffer_infos.write();
let mut buffers = self.resources.buffers.write();
@@ -203,6 +204,7 @@ impl RenderResourceContext for WgpuRenderResourceContext {
}
fn create_buffer_with_data(&self, mut buffer_info: BufferInfo, data: &[u8]) -> BufferId {
+ println!("create_buffer_with_data");
// TODO: consider moving this below "create" for efficiency
let mut buffer_infos = self.resources.buffer_infos.write();
let mut buffers = self.resources.buffers.write();
and run
cargo run --example sprite
What you expected to happen
there should be constant number of buffers allocated
What actually happened
New buffers are created all the time (for sprite example it is like ~3 new buffers per frame)
Additional information
Reactions are currently unavailable
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 times