From: Jeremy Gebben Date: Tue, 3 Nov 2020 16:18:14 +0000 (-0700) Subject: Fix RenderPass loadOp synchronization hazards. X-Git-Tag: upstream/1.3.5~1084 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=993119237c6012d736b9b7da282b348bb575f952;p=platform%2Fupstream%2FVK-GL-CTS.git Fix RenderPass loadOp synchronization hazards. Fix synchronization validation errors similar to: "vkCmdBeginRenderPass: Hazard READ_AFTER_WRITE in subpass 0 for attachment 0 aspect color during load with loadOp VK_ATTACHMENT_LOAD_OP_LOAD. Access info (usage: SYNC_COLOR_ATTACHMENT_OUTPUT_COLOR_ATTACHMENT_READ, prior_usage: SYNC_IMAGE_LAYOUT_TRANSITION, write_barriers: ....)" VK_ATTACHMENT_LOAD_OP_LOAD requires VK_ACCESS_COLOR_ATTACHMENT_READ_BIT. VK_ATTACHMENT_LOAD_OP_DONT_CARE and VK_ATTACHMENT_LOAD_OP_CLEAR require VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT. VK-GL-CTS Issue: 2690 Affected Tests: dEQP-VK.binding_model.descriptorset_random.* dEQP-VK.binding_model.descriptor_update.samplerless.* dEQP-VK.renderpass.suballocation.subpass_dependencies.* dEQP-VK.renderpass2.suballocation.subpass_dependencies.* Components: Vulkan Change-Id: Ieff35623329e4993f3745dbb65e6996edd422c31 --- diff --git a/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp b/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp index bf0e4e5..0cdf13b 100644 --- a/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp +++ b/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorSetRandomTests.cpp @@ -2453,9 +2453,9 @@ tcu::TestStatus DescriptorSetRandomTestInstance::iterate (void) VK_SUBPASS_EXTERNAL, // deUint32 srcSubpass 0, // deUint32 dstSubpass VK_PIPELINE_STAGE_TRANSFER_BIT, // VkPipelineStageFlags srcStageMask - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // dstStageMask VK_ACCESS_TRANSFER_WRITE_BIT, // VkAccessFlags srcAccessMask - VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT, // dstAccessMask + VK_ACCESS_INPUT_ATTACHMENT_READ_BIT | VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // dstAccessMask VK_DEPENDENCY_BY_REGION_BIT // VkDependencyFlags dependencyFlags }; diff --git a/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorUpdateTests.cpp b/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorUpdateTests.cpp index e74eda3..5c45842 100644 --- a/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorUpdateTests.cpp +++ b/external/vulkancts/modules/vulkan/binding_model/vktBindingDescriptorUpdateTests.cpp @@ -612,7 +612,8 @@ tcu::TestStatus SamplerlessDescriptorWriteTestInstance::iterate (void) const auto vtxBufferBarrier = vk::makeBufferMemoryBarrier(vk::VK_ACCESS_HOST_WRITE_BIT, vk::VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, vertexBuffer.get(), 0ull, vertexBufferSize); const auto preClearBarrier = vk::makeImageMemoryBarrier(0u, vk::VK_ACCESS_TRANSFER_WRITE_BIT, vk::VK_IMAGE_LAYOUT_UNDEFINED, vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, mainImage.get(), colorSubresourceRange); - const auto postClearBarrier = vk::makeImageMemoryBarrier(vk::VK_ACCESS_TRANSFER_WRITE_BIT, vk::VK_ACCESS_SHADER_READ_BIT, vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, getMainImageShaderLayout(), mainImage.get(), colorSubresourceRange); + const auto postClearBarrier = vk::makeImageMemoryBarrier(vk::VK_ACCESS_TRANSFER_WRITE_BIT, vk::VK_ACCESS_SHADER_READ_BIT | vk::VK_ACCESS_COLOR_ATTACHMENT_READ_BIT, + vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, getMainImageShaderLayout(), mainImage.get(), colorSubresourceRange); const auto clearDescColor = vk::makeClearValueColor(kDescriptorColor); vk::beginCommandBuffer(vkd, cmdBuffer); @@ -620,7 +621,7 @@ tcu::TestStatus SamplerlessDescriptorWriteTestInstance::iterate (void) vkd.cmdPipelineBarrier(cmdBuffer, vk::VK_PIPELINE_STAGE_HOST_BIT, vk::VK_PIPELINE_STAGE_VERTEX_INPUT_BIT, 0u, 0u, nullptr, 1u, &vtxBufferBarrier, 0u, nullptr); vkd.cmdPipelineBarrier(cmdBuffer, vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, 0u, 0u, nullptr, 0u, nullptr, 1u, &preClearBarrier); vkd.cmdClearColorImage(cmdBuffer, mainImage.get(), vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, &clearDescColor.color, 1u, &colorSubresourceRange); - vkd.cmdPipelineBarrier(cmdBuffer, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, vk::VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, 0u, 0u, nullptr, 0u, nullptr, 1u, &postClearBarrier); + vkd.cmdPipelineBarrier(cmdBuffer, vk::VK_PIPELINE_STAGE_TRANSFER_BIT, vk::VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, 0u, 0u, nullptr, 0u, nullptr, 1u, &postClearBarrier); vk::beginRenderPass(vkd, cmdBuffer, renderPass.get(), framebuffer.get(), renderArea, clearFbColor); vkd.cmdBindPipeline(cmdBuffer, vk::VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline.get()); diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSubpassDependencyTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSubpassDependencyTests.cpp index 0a467bb..e4e58e2 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSubpassDependencyTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassSubpassDependencyTests.cpp @@ -3918,16 +3918,16 @@ void initTests (tcu::TestCaseGroup* group, const RenderPassType renderPassType) deps.push_back(SubpassDependency(VK_SUBPASS_EXTERNAL, // deUint32 srcPass 0, // deUint32 dstPass VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags srcStageMask - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags dstStageMask + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags dstStageMask VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, // VkAccessFlags dstAccessMask + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask 0)); // VkDependencyFlags flags deps.push_back(SubpassDependency(0, // deUint32 srcPass VK_SUBPASS_EXTERNAL, // deUint32 dstPass - VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT, // VkPipelineStageFlags srcStageMask + VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags srcStageMask VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, // VkPipelineStageFlags dstStageMask - VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT, // VkAccessFlags srcAccessMask + VK_ACCESS_SHADER_READ_BIT | VK_ACCESS_SHADER_WRITE_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags srcAccessMask VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, // VkAccessFlags dstAccessMask 0)); // VkDependencyFlags flags