Fix barrier VK_AMD_buffer_marker
authorArkadiusz Sarwa <arkadiusz.sarwa@amd.com>
Tue, 23 Aug 2022 15:08:55 +0000 (17:08 +0200)
committerArkadiusz Sarwa <arkadiusz.sarwa@amd.com>
Tue, 23 Aug 2022 15:08:55 +0000 (17:08 +0200)
Affected tests:
dEQP-VK.api.buffer_marker.*

Components: Vulkan
VK-GL-CTS issue: 3854

Change-Id: Ia65c7ec44db3019125012b7d7e2d1b65e0f942f6

external/vulkancts/modules/vulkan/api/vktApiBufferMarkerTests.cpp

index 64a7246..f502902 100644 (file)
@@ -415,26 +415,26 @@ enum MemoryDepOwner
        MEMORY_DEP_OWNER_NON_MARKER = 2
 };
 
-void computeMemoryDepBarrier(MemoryDepMethod                   method,
-                                                        MemoryDepOwner                         owner,
-                                                        VkAccessFlags*                         memoryDepAccess,
-                                                        VkPipelineStageFlags*          executionScope)
+void computeMemoryDepBarrier(const MemoryDepParams&                    params,
+                                                        MemoryDepOwner                                 owner,
+                                                        VkAccessFlags*                                 memoryDepAccess,
+                                                        VkPipelineStageFlags*                  executionScope)
 {
        DE_ASSERT(owner != MEMORY_DEP_OWNER_NOBODY);
 
        if (owner == MEMORY_DEP_OWNER_MARKER)
        {
                *memoryDepAccess = VK_ACCESS_TRANSFER_WRITE_BIT;
-               *executionScope  = VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT;
+               *executionScope  = params.base.stage | VK_PIPELINE_STAGE_TRANSFER_BIT;
        }
        else
        {
-               if (method == MEMORY_DEP_COPY)
+               if (params.method == MEMORY_DEP_COPY)
                {
                        *memoryDepAccess = VK_ACCESS_TRANSFER_WRITE_BIT;
                        *executionScope  = VK_PIPELINE_STAGE_TRANSFER_BIT;
                }
-               else if (method == MEMORY_DEP_DISPATCH)
+               else if (params.method == MEMORY_DEP_DISPATCH)
                {
                        *memoryDepAccess = VK_ACCESS_SHADER_WRITE_BIT;
                        *executionScope  = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
@@ -879,8 +879,8 @@ tcu::TestStatus bufferMarkerMemoryDep(Context& context, MemoryDepParams params)
                        VkPipelineStageFlags srcStageMask;
                        VkPipelineStageFlags dstStageMask;
 
-                       computeMemoryDepBarrier(params.method, oldOwner, &memoryDep.srcAccessMask, &srcStageMask);
-                       computeMemoryDepBarrier(params.method, newOwner, &memoryDep.dstAccessMask, &dstStageMask);
+                       computeMemoryDepBarrier(params, oldOwner, &memoryDep.srcAccessMask, &srcStageMask);
+                       computeMemoryDepBarrier(params, newOwner, &memoryDep.dstAccessMask, &dstStageMask);
 
                        vk.cmdPipelineBarrier(*cmdBuffer, srcStageMask, dstStageMask, 0, 0, DE_NULL, 1, &memoryDep, 0, DE_NULL);
                }