From 9a24345d12354b4b9a2eb1588410eded0c683c5a Mon Sep 17 00:00:00 2001 From: gents83 Date: Wed, 13 Sep 2023 08:11:24 +0200 Subject: [PATCH] Add release of buffer and description on texture --- tests/tests/mem_leaks.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/tests/tests/mem_leaks.rs b/tests/tests/mem_leaks.rs index 2e364a850f..05a7026a40 100644 --- a/tests/tests/mem_leaks.rs +++ b/tests/tests/mem_leaks.rs @@ -214,6 +214,7 @@ fn draw_test_with_reports( drop(ppl); drop(bgl); drop(bg); + drop(buffer); let global_report = ctx.instance.generate_report(); let report = global_report.hub_report(); @@ -229,6 +230,8 @@ fn draw_test_with_reports( assert_eq!(report.bind_groups.num_kept_from_user, 0); assert_eq!(report.texture_views.num_allocated, 1); assert_eq!(report.texture_views.num_kept_from_user, 0); + assert_eq!(report.buffers.num_allocated, 1); + assert_eq!(report.buffers.num_kept_from_user, 0); assert_eq!(report.textures.num_allocated, 1); assert_eq!(report.textures.num_kept_from_user, 0); @@ -248,17 +251,24 @@ fn draw_test_with_reports( assert_eq!(report.bind_group_layouts.num_allocated, 0); assert_eq!(report.pipeline_layouts.num_allocated, 0); assert_eq!(report.texture_views.num_allocated, 0); - assert_eq!(report.textures.num_allocated, 1); - assert_eq!(report.buffers.num_allocated, 1); + assert_eq!(report.buffers.num_allocated, 0); drop(ctx.queue); drop(ctx.device); + drop(ctx.adapter); let global_report = ctx.instance.generate_report(); let report = global_report.hub_report(); - assert_eq!(report.devices.num_kept_from_user, 0); assert_eq!(report.queues.num_kept_from_user, 0); + assert_eq!(report.queues.num_allocated, 0); + //Still one texture alive because surface is not dropped till the end + assert_eq!(report.textures.num_allocated, 1); + //that is keeping still the device alive + assert_eq!(report.devices.num_allocated, 1); + assert_eq!(report.textures.num_kept_from_user, 0); + assert_eq!(report.devices.num_kept_from_user, 0); + } #[test]