From: Piers Daniell Date: Wed, 29 Sep 2021 14:04:22 +0000 (-0600) Subject: Fix invalid layout transitions in some dynamic rendering tests X-Git-Tag: upstream/1.3.5~332^2~81 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=06187ab8c572cc8227224841ffcc4660b90a8d39;p=platform%2Fupstream%2FVK-GL-CTS.git Fix invalid layout transitions in some dynamic rendering tests Some of the dynamic rendering tests do an image layout transition from uninitialized when the image is already in use. This can lead to corruption of the image content. This CL removes an unnecessary barrier from the dEQP-VK.multiview.dynamic_rendering.readback* tests and fixes a barrier with the dEQP-VK.multiview.dynamic_rendering.depth.* and dEQP-VK.multiview.dynamic_rendering.stencil.* tests. Affects: dEQP-VK.multiview.dynamic_rendering.depth.* dEQP-VK.multiview.dynamic_rendering.stencil.* dEQP-VK.multiview.dynamic_rendering.readback* Components: Vulkan VK-GL-CTS issue: 3164 Change-Id: Ib0847839528909337001d32bbde59c7e979ec9e9 --- diff --git a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp index c519913..c7d0c0a 100644 --- a/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp +++ b/external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp @@ -3098,27 +3098,7 @@ void MultiViewReadbackTestInstance::drawClears (const deUint32 subpassCount, VkR if (clearPass) beforeDraw(); - if (m_useDynamicRendering) - { - const VkImageSubresourceRange subresourceRange = makeImageSubresourceRange(VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u); - const VkImageMemoryBarrier imageBarrier - { - VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER, // VkStructureType sType; - DE_NULL, // const void* pNext; - 0u, // VkAccessFlags outputMask; - VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags inputMask; - VK_IMAGE_LAYOUT_UNDEFINED, // VkImageLayout oldLayout; - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, // VkImageLayout newLayout; - VK_QUEUE_FAMILY_IGNORED, // deUint32 srcQueueFamilyIndex; - VK_QUEUE_FAMILY_IGNORED, // deUint32 destQueueFamilyIndex; - m_colorAttachment->getImage(), // VkImage image; - subresourceRange, // VkImageSubresourceRange subresourceRange; - }; - - m_device->cmdPipelineBarrier(*m_cmdBuffer, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, (vk::VkDependencyFlags)0, 0, - (const vk::VkMemoryBarrier*)DE_NULL, 0, (const vk::VkBufferMemoryBarrier*)DE_NULL, 1, &imageBarrier); - } - else + if (!m_useDynamicRendering) { const VkRenderPassBeginInfo renderPassBeginInfo { @@ -3650,9 +3630,9 @@ void MultiViewDepthStencilTestInstance::beforeDraw (void) m_parameters.extent.depth, //deUint32 layerCount; }; imageBarrier(*m_device, *m_cmdBuffer, m_dsAttachment->getImage(), subresourceRange, - VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - 0, VK_ACCESS_TRANSFER_WRITE_BIT, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); + VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, VK_ACCESS_TRANSFER_WRITE_BIT, + VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT); const tcu::Vec4 baseColor = getQuarterRefColor(0u, 0u, 0u, false); const float clearDepth = baseColor[0];