From 086f7b00b78ce690d169dd2f28c3c6b56d9d22cf Mon Sep 17 00:00:00 2001 From: Gary Sweet Date: Wed, 7 Jun 2017 11:52:34 +0100 Subject: [PATCH] Delete pipeline in dEQP-VK.renderpass.multisample The pipeline objects were not being destroyed at the end of the test as they weren't held in shared pointers like everything else is. Affects: dEQP-VK.renderpass.multisample.* Components: Vulkan VK-GL-CTS issue: 468 Change-Id: I17b8afbb62b2b9c55e89939a02d76b72ed5c09ff --- .../renderpass/vktRenderPassMultisampleTests.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp index cb3e74c..fd07eac 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp @@ -1176,7 +1176,7 @@ Move createSplitPipeline (const DeviceInterface& vkd, return createGraphicsPipeline(vkd, device, DE_NULL, &createInfo); } -vector createSplitPipelines (const DeviceInterface& vkd, +vector createSplitPipelines (const DeviceInterface& vkd, VkDevice device, VkRenderPass renderPass, VkPipelineLayout pipelineLayout, @@ -1185,20 +1185,10 @@ vector createSplitPipelines (const DeviceInterface& vkd, deUint32 height, deUint32 sampleCount) { - vector pipelines (deDivRoundUp32(sampleCount, MAX_COLOR_ATTACHMENT_COUNT), (VkPipeline)0u); + std::vector pipelines (deDivRoundUp32(sampleCount, MAX_COLOR_ATTACHMENT_COUNT), (VkPipelineSp)0u); - try - { - for (size_t ndx = 0; ndx < pipelines.size(); ndx++) - pipelines[ndx] = createSplitPipeline(vkd, device, renderPass, (deUint32)(ndx + 1), pipelineLayout, binaryCollection, width, height, sampleCount).disown(); - } - catch (...) - { - for (size_t ndx = 0; ndx < pipelines.size(); ndx++) - vkd.destroyPipeline(device, pipelines[ndx], DE_NULL); - - throw; - } + for (size_t ndx = 0; ndx < pipelines.size(); ndx++) + pipelines[ndx] = safeSharedPtr(new Unique(createSplitPipeline(vkd, device, renderPass, (deUint32)(ndx + 1), pipelineLayout, binaryCollection, width, height, sampleCount))); return pipelines; } @@ -1377,7 +1367,7 @@ private: const Unique m_splitDescriptorSetLayout; const Unique m_splitPipelineLayout; - const vector m_splitPipelines; + const std::vector m_splitPipelines; const Unique m_splitDescriptorPool; const Unique m_splitDescriptorSet; @@ -1482,7 +1472,7 @@ tcu::TestStatus MultisampleRenderPassTestInstance::iterate (void) { vkd.cmdNextSubpass(*commandBuffer, VK_SUBPASS_CONTENTS_INLINE); - vkd.cmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, m_splitPipelines[splitPipelineNdx]); + vkd.cmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, **m_splitPipelines[splitPipelineNdx]); vkd.cmdBindDescriptorSets(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_splitPipelineLayout, 0u, 1u, &*m_splitDescriptorSet, 0u, DE_NULL); vkd.cmdPushConstants(*commandBuffer, *m_splitPipelineLayout, VK_SHADER_STAGE_FRAGMENT_BIT, 0u, sizeof(splitPipelineNdx), &splitPipelineNdx); vkd.cmdDraw(*commandBuffer, 6u, 1u, 0u, 0u); -- 2.7.4