From: Arkadiusz Sarwa Date: Wed, 13 Apr 2016 12:43:17 +0000 (+0200) Subject: Bug Fix: Corrected barriers in the tests dEQP-VK.query_pool X-Git-Tag: upstream/0.1.0~840^2~27^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0319b008a20f6c61504d39c118c0dc271e015c25;p=platform%2Fupstream%2FVK-GL-CTS.git Bug Fix: Corrected barriers in the tests dEQP-VK.query_pool --- diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp index d64a81d..4b15ecf 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.cpp @@ -431,7 +431,7 @@ de::SharedPtr Image::copyToLinearImage (vk::VkQueue queue, CmdBufferBeginInfo beginInfo; VK_CHECK(m_vk.beginCommandBuffer(*copyCmdBuffer, &beginInfo)); - transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL); + transition2DImage(m_vk, *copyCmdBuffer, stagingResource->object(), aspect, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_TRANSFER_WRITE_BIT); const vk::VkOffset3D zeroOffset = { 0, 0, 0 }; vk::VkImageCopy region = { {aspect, mipLevel, arrayElement, 1}, offset, {aspect, 0, 0, 1}, zeroOffset, {(deUint32)width, (deUint32)height, (deUint32)depth} }; @@ -855,22 +855,24 @@ de::SharedPtr Image::create(const vk::DeviceInterface& vk, } void transition2DImage (const vk::DeviceInterface& vk, - vk::VkCommandBuffer cmdBuffer, + vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, - vk::VkImageLayout newLayout) + vk::VkImageLayout newLayout, + vk::VkAccessFlags srcAccessMask, + vk::VkAccessFlags dstAccessMask) { vk::VkImageMemoryBarrier barrier; - barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; - barrier.pNext = DE_NULL; - barrier.srcAccessMask = 0; - barrier.dstAccessMask = 0; - barrier.oldLayout = oldLayout; - barrier.newLayout = newLayout; - barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; - barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; - barrier.image = image; + barrier.sType = vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER; + barrier.pNext = DE_NULL; + barrier.srcAccessMask = srcAccessMask; + barrier.dstAccessMask = dstAccessMask; + barrier.oldLayout = oldLayout; + barrier.newLayout = newLayout; + barrier.srcQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; + barrier.dstQueueFamilyIndex = vk::VK_QUEUE_FAMILY_IGNORED; + barrier.image = image; barrier.subresourceRange.aspectMask = aspectMask; barrier.subresourceRange.baseMipLevel = 0; barrier.subresourceRange.levelCount = 1; diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp index 48302c1..8e5871d 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolImageObjectUtil.hpp @@ -250,7 +250,14 @@ private: vk::VkDevice m_device; }; -void transition2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageAspectFlags aspectMask, vk::VkImageLayout oldLayout, vk::VkImageLayout newLayout); +void transition2DImage (const vk::DeviceInterface& vk, + vk::VkCommandBuffer cmdBuffer, + vk::VkImage image, + vk::VkImageAspectFlags aspectMask, + vk::VkImageLayout oldLayout, + vk::VkImageLayout newLayout, + vk::VkAccessFlags srcAccessMask = 0, + vk::VkAccessFlags dstAccessMask = 0); void initialTransitionColor2DImage (const vk::DeviceInterface& vk, vk::VkCommandBuffer cmdBuffer, vk::VkImage image, vk::VkImageLayout layout); diff --git a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp index 2057df4..22feecc 100644 --- a/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp +++ b/external/vulkancts/modules/vulkan/query_pool/vktQueryPoolOcclusionTests.cpp @@ -374,8 +374,8 @@ tcu::TestStatus BasicOcclusionQueryTestInstance::iterate (void) vk.beginCommandBuffer(*cmdBuffer, &beginInfo); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); std::vector renderPassClearValues(2); deMemset(&renderPassClearValues[0], 0, static_cast(renderPassClearValues.size()) * sizeof(vk::VkClearValue)); @@ -407,7 +407,7 @@ tcu::TestStatus BasicOcclusionQueryTestInstance::iterate (void) vk.cmdEndRenderPass(*cmdBuffer); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT); vk.endCommandBuffer(*cmdBuffer); @@ -723,8 +723,8 @@ vk::Move OcclusionQueryTestInstance::recordRender (vk::VkCo vk.beginCommandBuffer(*cmdBuffer, &beginInfo); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL); - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_GENERAL, 0, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_DepthImage->object(), vk::VK_IMAGE_ASPECT_DEPTH_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, 0, vk::VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT); std::vector renderPassClearValues(2); deMemset(&renderPassClearValues[0], 0, static_cast(renderPassClearValues.size()) * sizeof(vk::VkClearValue)); @@ -779,7 +779,7 @@ vk::Move OcclusionQueryTestInstance::recordRender (vk::VkCo } } - transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL); + transition2DImage(vk, *cmdBuffer, m_stateObjects->m_colorAttachmentImage->object(), vk::VK_IMAGE_ASPECT_COLOR_BIT, vk::VK_IMAGE_LAYOUT_GENERAL, vk::VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, vk::VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, vk::VK_ACCESS_TRANSFER_READ_BIT); vk.endCommandBuffer(*cmdBuffer);