From 33fba799401ba8e74907bf4bf7893d50f188e842 Mon Sep 17 00:00:00 2001 From: Ricardo Garcia Date: Mon, 4 Apr 2022 17:58:55 +0200 Subject: [PATCH] Fix freeing custom device in dynamic state tests Some dynamic state tests use a custom device that was not being properly freed when existing a test group that used the device. This sometimes caused crashes on program termination. No tests should be affected by this change. This fix only touches the test hierarchy. However, to check the fix doesn't break anything: dEQP-VK.dynamic_state.* Components: Vulkan VK-GL-CTS issue: 3602 Change-Id: I6bf97900497b6e795c1fbacef5b3fc68619a9ff4 --- .../modules/vulkan/dynamic_state/vktDynamicStateTests.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateTests.cpp b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateTests.cpp index 96d0639..9d13c5d 100644 --- a/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateTests.cpp +++ b/external/vulkancts/modules/vulkan/dynamic_state/vktDynamicStateTests.cpp @@ -56,9 +56,8 @@ void createChildren (tcu::TestCaseGroup* group, vk::PipelineConstructionType pip group->addChild(createDynamicStateComputeTests (testCtx)); } -static void cleanupGroup(tcu::TestCaseGroup* group) +static void cleanupGroup(tcu::TestCaseGroup*, vk::PipelineConstructionType) { - DE_UNREF(group); // Destroy singleton objects. cleanupDevice(); } @@ -67,9 +66,9 @@ static void cleanupGroup(tcu::TestCaseGroup* group) tcu::TestCaseGroup* createTests (tcu::TestContext& testCtx) { - de::MovePtr monolithicGroup (createTestGroup(testCtx, "monolithic", "Monolithic pipeline tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC)); - de::MovePtr pipelineLibraryGroup (createTestGroup(testCtx, "pipeline_library", "Graphics pipeline library tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY)); - de::MovePtr fastLinkedLibraryGroup (createTestGroup(testCtx, "fast_linked_library", "Fast linked graphics pipeline library tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_FAST_LINKED_LIBRARY)); + de::MovePtr monolithicGroup (createTestGroup(testCtx, "monolithic", "Monolithic pipeline tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_MONOLITHIC, cleanupGroup)); + de::MovePtr pipelineLibraryGroup (createTestGroup(testCtx, "pipeline_library", "Graphics pipeline library tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_LINK_TIME_OPTIMIZED_LIBRARY, cleanupGroup)); + de::MovePtr fastLinkedLibraryGroup (createTestGroup(testCtx, "fast_linked_library", "Fast linked graphics pipeline library tests", createChildren, vk::PIPELINE_CONSTRUCTION_TYPE_FAST_LINKED_LIBRARY, cleanupGroup)); de::MovePtr mainGroup(new tcu::TestCaseGroup(testCtx, "dynamic_state", "Dynamic State Tests")); mainGroup->addChild(monolithicGroup.release()); -- 2.7.4