From 6222af852976871f07c00b792cae50eb458d0703 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Fri, 22 Apr 2016 10:32:12 -0700 Subject: [PATCH] Fix pipeline and pipeline cache lifetime in synchronization tests Bug: 28074219 Change-Id: Ib2b40524c9009129377cf5ba15e91fa86e74245c --- external/vulkancts/modules/vulkan/vktSynchronization.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/external/vulkancts/modules/vulkan/vktSynchronization.cpp b/external/vulkancts/modules/vulkan/vktSynchronization.cpp index c3a5c77..d541fc9 100644 --- a/external/vulkancts/modules/vulkan/vktSynchronization.cpp +++ b/external/vulkancts/modules/vulkan/vktSynchronization.cpp @@ -452,7 +452,7 @@ struct RenderInfo VkCommandBuffer commandBuffer; VkRenderPass renderPass; VkFramebuffer framebuffer; - vk::Move pipeline; + VkPipeline pipeline; deUint32 mipLevels; const deUint32* queueFamilyNdxList; deUint32 queueFamilyNdxCount; @@ -484,7 +484,7 @@ void recordRenderPass (const DeviceInterface& deviceInterface, const RenderInfo deviceInterface.cmdBeginRenderPass(renderInfo.commandBuffer, &renderPassBeginState, VK_SUBPASS_CONTENTS_INLINE); if (renderInfo.waitEvent) deviceInterface.cmdWaitEvents(renderInfo.commandBuffer, 1, &renderInfo.event, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, 0, DE_NULL, 0, DE_NULL, 0, DE_NULL); - deviceInterface.cmdBindPipeline(renderInfo.commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, renderInfo.pipeline.get()); + deviceInterface.cmdBindPipeline(renderInfo.commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, renderInfo.pipeline); deviceInterface.cmdBindVertexBuffers(renderInfo.commandBuffer, 0u, 1u, &renderInfo.vertexBuffer, &bindingOffset); deviceInterface.cmdDraw(renderInfo.commandBuffer, renderInfo.vertexBufferSize, 1, 0, 0); if (renderInfo.setEvent) @@ -582,6 +582,8 @@ struct TestContext vk::Move commandPool; vk::Move cmdBuffer; vk::Move renderPass; + vk::Move pipelineCache; + vk::Move pipeline; MovePtr imageAllocation; TestContext (const DeviceInterface& vkd_, @@ -645,9 +647,7 @@ void generateWork (TestContext& testContext) } }; - vk::Move cache; vk::Move layout; - vk::Move pipeline; vector shaderDescParams; VertexDesc vertexDesc; vector vertexDescList; @@ -874,8 +874,8 @@ void generateWork (TestContext& testContext) cacheState.initialDataSize = 0; cacheState.pInitialData = DE_NULL; - cache = createPipelineCache(deviceInterface, testContext.device, &cacheState); - pipeline = createGraphicsPipeline(deviceInterface, testContext.device, cache.get(), &pipelineState); + testContext.pipelineCache = createPipelineCache(deviceInterface, testContext.device, &cacheState); + testContext.pipeline = createGraphicsPipeline(deviceInterface, testContext.device, testContext.pipelineCache.get(), &pipelineState); deMemset(&fbState, 0xcd, sizeof(fbState)); fbState.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO; @@ -926,7 +926,7 @@ void generateWork (TestContext& testContext) renderInfo.commandBuffer = testContext.cmdBuffer.get(); renderInfo.renderPass = testContext.renderPass.get(); renderInfo.framebuffer = *testContext.framebuffer; - renderInfo.pipeline = pipeline; + renderInfo.pipeline = *testContext.pipeline; renderInfo.mipLevels = 1; renderInfo.queueFamilyNdxList = &queueFamilyNdx; renderInfo.queueFamilyNdxCount = 1; -- 2.7.4