From 88edcad8679adbd1ad7924be6e94cfcb5c8082fc Mon Sep 17 00:00:00 2001 From: Tatsuyuki Ishi Date: Mon, 20 Mar 2023 16:51:09 +0900 Subject: [PATCH] Fix missing dependency on sparse binds The affected tests below used a sparse binding but did not wait for the semaphore to be signaled before performing operations on the image. Fix the synchronization by waiting for the semaphore on all submissions that uses the sparse binding. Affects: dEQP-VK.image.mismatched_formats.sparse_image_read.* dEQP-VK.pipeline.*_sparse dEQP-VK.*.sparserendertarget.* Components: Vulkan VK-GL-CTS issue: 4336 Change-Id: If96817059394e368f142b224515f6546d901756b --- .../modules/vulkan/image/vktImageMismatchedFormatsTests.cpp | 3 ++- .../modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp | 10 +++++++++- .../vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp | 6 ++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/external/vulkancts/modules/vulkan/image/vktImageMismatchedFormatsTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageMismatchedFormatsTests.cpp index b6ad82b..a99eb51 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageMismatchedFormatsTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageMismatchedFormatsTests.cpp @@ -443,7 +443,8 @@ tcu::TestStatus MismatchedFormatTestInstance::iterate (void) vk.cmdDispatch(*cmdBuffer, 8, 8, 1); endCommandBuffer(vk, *cmdBuffer); - submitCommandsAndWait(vk, device, queue, *cmdBuffer); + const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TRANSFER_BIT }; + submitCommandsAndWait(vk, device, queue, *cmdBuffer, false, 1u, 1u, &bindSemaphore.get(), stageBits); return tcu::TestStatus::pass("Passed"); } diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp index 29fe56f..165b755 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleTests.cpp @@ -4528,7 +4528,15 @@ de::MovePtr MultisampleRenderer::render (void) const VkQueue queue = m_context.getUniversalQueue(); const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex(); - submitCommandsAndWait(vk, vkDevice, queue, m_cmdBuffer.get()); + if (m_backingMode == IMAGE_BACKING_MODE_SPARSE) + { + const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TRANSFER_BIT }; + submitCommandsAndWait(vk, vkDevice, queue, m_cmdBuffer.get(), false, 1u, 1u, &m_bindSemaphore.get(), stageBits); + } + else + { + submitCommandsAndWait(vk, vkDevice, queue, m_cmdBuffer.get()); + } if (m_renderType == RENDER_TYPE_RESOLVE || m_renderType == RENDER_TYPE_DEPTHSTENCIL_ONLY || m_renderType == RENDER_TYPE_UNUSED_ATTACHMENT) { diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp index 863d581..9589281 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSparseRenderTargetTests.cpp @@ -541,7 +541,8 @@ tcu::TestStatus SparseRenderTargetTestInstance::iterateInternal (void) endCommandBuffer(vkd, *commandBuffer); - submitCommandsAndWait(vkd, m_context.getDevice(), m_context.getUniversalQueue(), *commandBuffer); + const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TRANSFER_BIT }; + submitCommandsAndWait(vkd, m_context.getDevice(), m_context.getUniversalQueue(), *commandBuffer, false, 1u, 1u, &m_bindSemaphore.get(), stageBits); return verify(); } @@ -628,7 +629,8 @@ tcu::TestStatus SparseRenderTargetTestInstance::iterateInternalDynamicRendering( endCommandBuffer(vkd, *cmdBuffer); - submitCommandsAndWait(vkd, m_context.getDevice(), m_context.getUniversalQueue(), *cmdBuffer); + const VkPipelineStageFlags stageBits[] = { VK_PIPELINE_STAGE_TRANSFER_BIT }; + submitCommandsAndWait(vkd, m_context.getDevice(), m_context.getUniversalQueue(), *cmdBuffer, false, 1u, 1u, &m_bindSemaphore.get(), stageBits); return verify(); } -- 2.7.4