Fix VkPipelineLayout use after free
authorSlawomir Cygan <slawomir.cygan@intel.com>
Wed, 18 Apr 2018 13:56:37 +0000 (15:56 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 25 May 2018 11:39:11 +0000 (07:39 -0400)
The test destroys pipeline layout, used to create the graphics pipeline,
before the command buffer using this pipeline is recorded.

This is invalid according to spec:
"A VkPipelineLayout object must not be destroyed while any
command buffer that uses it is in the recording state."

Components: Vulkan

VK-GL-CTS Issue: 1134

Affects:
dEQP-VK.draw.differing_interpolation.*

Change-Id: I2dd692cfb69afaf0b9d6e8d8a29b86b945b7eaba

external/vulkancts/modules/vulkan/draw/vktDrawDifferingInterpolationTests.cpp

index 34fdd82..430a21e 100644 (file)
@@ -248,10 +248,11 @@ tcu::TestStatus DrawTestInstance::iterate (void)
                        flushMappedMemoryRange(vk, device, vertexBuffer->getBoundMemory().getMemory(), vertexBuffer->getBoundMemory().getOffset(), VK_WHOLE_SIZE);
                }
 
+               const PipelineLayoutCreateInfo  pipelineLayoutCreateInfo;
+               Move<VkPipelineLayout>                  pipelineLayout = createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
+
                // Create pipeline
                {
-                       const PipelineLayoutCreateInfo  pipelineLayoutCreateInfo;
-                       Move<VkPipelineLayout>                  pipelineLayout = createPipelineLayout(vk, device, &pipelineLayoutCreateInfo);
                        const PipelineCreateInfo::ColorBlendState::Attachment vkCbAttachmentState;
 
                        VkViewport viewport;