Fixes for Protected Memory
authorMartin Freebody <martin.freebody@mobica.com>
Wed, 7 Nov 2018 12:40:32 +0000 (12:40 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 15 Nov 2018 08:36:46 +0000 (03:36 -0500)
This change removes errors reported by core validation layer.

Affects: dEQP-VK.protected_memory.*

Components: Vulkan

Change-Id: Id7223e5777747345778babe83b0d9c3605a4ce1f

external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemBlitImageTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemClearColorImageTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemCopyImageTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemShaderImageAccessTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemStorageBufferTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemWsiSwapchainTests.cpp
external/vulkancts/modules/vulkan/protected_memory/vktProtectedMemYCbCrConversionTests.cpp

index 669826a..bed4569 100644 (file)
@@ -185,13 +185,13 @@ tcu::TestStatus BlitImageTestInstance::iterate()
                        }
                };
 
-               vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-                                                         (vk::VkDependencyFlags)0,
-                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,
-                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
-                                                         1, &startImgBarrier);
+               vk.cmdPipelineBarrier(targetCmdBuffer,                                                                  // commandBuffer
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                        // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,                           // dstStageMask
+                                                         (vk::VkDependencyFlags)0,                                                     // dependencyFlags
+                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,                       // memoryBarrierCount, pMemoryBarriers
+                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL,         // bufferMemoryBarrierCount, pBufferMemoryBarriers
+                                                         1, &startImgBarrier);                                                         // imageMemoryBarrierCount, pImageMemoryBarriers
        }
 
        // Image clear
@@ -228,8 +228,8 @@ tcu::TestStatus BlitImageTestInstance::iterate()
                };
 
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,   // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,   // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -259,8 +259,8 @@ tcu::TestStatus BlitImageTestInstance::iterate()
                };
 
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,                   // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -293,6 +293,7 @@ tcu::TestStatus BlitImageTestInstance::iterate()
        vk.cmdBlitImage(targetCmdBuffer, **colorImageSrc, vk::VK_IMAGE_LAYOUT_GENERAL,
                                        **colorImage, vk::VK_IMAGE_LAYOUT_GENERAL, 1u, &imageBlit, vk::VK_FILTER_NEAREST);
 
+       // Image barrier to change accessMask to shader read bit for destination image.
        {
                const vk::VkImageMemoryBarrier  endImgBarrier   =
                {
@@ -314,8 +315,8 @@ tcu::TestStatus BlitImageTestInstance::iterate()
                        }
                };
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,           // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,       // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
index 3dce6e7..35d35e4 100644 (file)
@@ -180,18 +180,19 @@ tcu::TestStatus ClearColorImageTestInstance::iterate()
                        subresourceRange,                                                                       // subresourceRange
                };
 
-               vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-                                                         (vk::VkDependencyFlags)0,
-                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,
-                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
-                                                         1, &initializeBarrier);
+               vk.cmdPipelineBarrier(targetCmdBuffer,                                                          // commandBuffer
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,                   // dstStageMask
+                                                         (vk::VkDependencyFlags)0,                                             // dependencyFlags
+                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,               // memoryBarrierCount, pMemoryBarriers
+                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL, // bufferMemoryBarrierCount, pBufferMemoryBarriers
+                                                         1, &initializeBarrier);                                               // imageMemoryBarrierCount, pImageMemoryBarriers
        }
 
        // Image clear
        vk.cmdClearColorImage(targetCmdBuffer, **colorImage, vk::VK_IMAGE_LAYOUT_GENERAL, &m_clearColorValue, 1, &subresourceRange);
 
+       // Image barrier to change accessMask.
        {
                const vk::VkImageMemoryBarrier  initializeBarrier       =
                {
@@ -207,8 +208,8 @@ tcu::TestStatus ClearColorImageTestInstance::iterate()
                        subresourceRange                                                                        // subresourceRange
                };
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,           // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,       // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
index ed7cc88..2ebbf72 100644 (file)
@@ -185,13 +185,13 @@ tcu::TestStatus CopyImageTestInstance::iterate()
                        }
                };
 
-               vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
-                                                         (vk::VkDependencyFlags)0,
-                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,
-                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
-                                                         1, &startImgBarrier);
+               vk.cmdPipelineBarrier(targetCmdBuffer,                                                          // commandBuffer
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,               // dstStageMask
+                                                         (vk::VkDependencyFlags)0,                                             // dependencyFlags
+                                                         0, (const vk::VkMemoryBarrier*)DE_NULL,               // memoryBarrierCount, pMemoryBarriers
+                                                         0, (const vk::VkBufferMemoryBarrier*)DE_NULL, // bufferMemoryBarrierCount, pBufferMemoryBarriers
+                                                         1, &startImgBarrier);                                                 // imageMemoryBarrierCount, pImageMemoryBarriers
        }
 
        // Image clear
@@ -228,8 +228,8 @@ tcu::TestStatus CopyImageTestInstance::iterate()
                };
 
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,   // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,   // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -259,8 +259,8 @@ tcu::TestStatus CopyImageTestInstance::iterate()
                };
 
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,        // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,           // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -286,9 +286,12 @@ tcu::TestStatus CopyImageTestInstance::iterate()
                imageExtent,                                                    // VkExtent3D                           extent;
 
        };
-       vk.cmdCopyImage(targetCmdBuffer, **colorImageSrc, vk::VK_IMAGE_LAYOUT_GENERAL,
-                                       **colorImage, vk::VK_IMAGE_LAYOUT_GENERAL, 1u, &copyImageRegion);
+       vk.cmdCopyImage(targetCmdBuffer,
+                                       **colorImageSrc, vk::VK_IMAGE_LAYOUT_GENERAL,   // srcImageLayout
+                                       **colorImage, vk::VK_IMAGE_LAYOUT_GENERAL,              // dstImageLayout
+                                       1u, &copyImageRegion);
 
+       // Image barrier to change accessMask for destination image.
        {
                const vk::VkImageMemoryBarrier  endImgBarrier   =
                {
@@ -310,8 +313,8 @@ tcu::TestStatus CopyImageTestInstance::iterate()
                        }
                };
                vk.cmdPipelineBarrier(targetCmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TRANSFER_BIT,           // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,       // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
index 6648faf..5a370b9 100644 (file)
@@ -978,8 +978,8 @@ tcu::TestStatus ImageAccessTestInstance::executeFragmentTest (void)
                };
 
                vk.cmdPipelineBarrier(*cmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                                // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,    // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -1023,8 +1023,8 @@ tcu::TestStatus ImageAccessTestInstance::executeFragmentTest (void)
                        }
                };
                vk.cmdPipelineBarrier(*cmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,    // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,                               // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
index 5f0cc7b..43bbdeb 100644 (file)
@@ -140,9 +140,10 @@ void static addBufferCopyCmd (const vk::DeviceInterface&   vk,
                0u,                                                                                                     // VkDeviceSize                 offset
                VK_WHOLE_SIZE,                                                                          // VkDeviceSize                 size
        };
+
        vk.cmdPipelineBarrier(cmdBuffer,
-                                                 vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                 vk::VK_PIPELINE_STAGE_TRANSFER_BIT,
+                                                 vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,        // srcStageMask
+                                                 vk::VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,      // dstStageMask
                                                  (vk::VkDependencyFlags)0,
                                                  0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                  1, &dstWriteStartBarrier,
@@ -160,7 +161,7 @@ void static addBufferCopyCmd (const vk::DeviceInterface&    vk,
        {
                vk::VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,            // VkStructureType              sType
                DE_NULL,                                                                                        // const void*                  pNext
-               vk::VK_ACCESS_TRANSFER_WRITE_BIT,                                       // VkAccessFlags                srcAccessMask
+               vk::VK_ACCESS_SHADER_WRITE_BIT,                                         // VkAccessFlags                srcAccessMask
                vk::VK_ACCESS_SHADER_READ_BIT,                                          // VkAccessFlags                dstAccessMask
                queueFamilyIndex,                                                                       // uint32_t                             srcQueueFamilyIndex
                queueFamilyIndex,                                                                       // uint32_t                             dstQueueFamilyIndex
@@ -169,8 +170,8 @@ void static addBufferCopyCmd (const vk::DeviceInterface&    vk,
                VK_WHOLE_SIZE,                                                                          // VkDeviceSize                 size
        };
        vk.cmdPipelineBarrier(cmdBuffer,
-                                                 vk::VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
-                                                 vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
+                                                 vk::VK_PIPELINE_STAGE_VERTEX_SHADER_BIT,              // srcStageMask
+                                                 vk::VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,    // dstStageMask
                                                  (vk::VkDependencyFlags)0,
                                                  0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                  1, &dstWriteEndBarrier,
@@ -481,8 +482,8 @@ tcu::TestStatus StorageBufferTestInstance<T>::executeFragmentTest(void)
                };
 
                vk.cmdPipelineBarrier(*cmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                                // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,    // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
@@ -517,8 +518,8 @@ tcu::TestStatus StorageBufferTestInstance<T>::executeFragmentTest(void)
                        }
                };
                vk.cmdPipelineBarrier(*cmdBuffer,
-                                                         vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
-                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,
+                                                         vk::VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,    // srcStageMask
+                                                         vk::VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT,                               // dstStageMask
                                                          (vk::VkDependencyFlags)0,
                                                          0, (const vk::VkMemoryBarrier*)DE_NULL,
                                                          0, (const vk::VkBufferMemoryBarrier*)DE_NULL,
index 37c3791..509851f 100644 (file)
@@ -204,6 +204,21 @@ struct TestParameters
        {}
 };
 
+static vk::VkCompositeAlphaFlagBitsKHR firstSupportedCompositeAlpha(const vk::VkSurfaceCapabilitiesKHR& capabilities)
+{
+       deUint32 alphaMode = 1u;
+
+       for (;alphaMode < capabilities.supportedCompositeAlpha; alphaMode = alphaMode<<1u)
+       {
+               if ((alphaMode & capabilities.supportedCompositeAlpha) != 0)
+               {
+                       break;
+               }
+       }
+
+       return (vk::VkCompositeAlphaFlagBitsKHR)alphaMode;
+}
+
 std::vector<vk::VkSwapchainCreateInfoKHR> generateSwapchainParameterCases (vk::wsi::Type                                                               wsiType,
                                                                                                                                                   TestDimension                                                                dimension,
                                                                                                                                                   const ProtectedContext&                                              context,
@@ -232,7 +247,7 @@ std::vector<vk::VkSwapchainCreateInfoKHR> generateSwapchainParameterCases (vk::w
                0u,
                (const deUint32*)DE_NULL,
                defaultTransform,
-               vk::VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
+               firstSupportedCompositeAlpha(capabilities),
                vk::VK_PRESENT_MODE_FIFO_KHR,
                VK_FALSE,                                                       // clipped
                (vk::VkSwapchainKHR)0                           // oldSwapchain
@@ -703,7 +718,7 @@ vk::VkSwapchainCreateInfoKHR getBasicSwapchainParameters (vk::wsi::Type                                     wsiT
                0u,
                (const deUint32*)DE_NULL,
                transform,
-               vk::VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
+               firstSupportedCompositeAlpha(capabilities),
                vk::VK_PRESENT_MODE_FIFO_KHR,
                VK_FALSE,                                                       // clipped
                (vk::VkSwapchainKHR)0                           // oldSwapchain
@@ -1094,7 +1109,7 @@ tcu::TestStatus basicRenderTest (Context& baseCtx, vk::wsi::Type wsiType)
                                                                                                                                                          *swapchain,
                                                                                                                                                          std::numeric_limits<deUint64>::max(),
                                                                                                                                                          imageReadySemaphore,
-                                                                                                                                                         imageReadyFence,
+                                                                                                                                                         0,
                                                                                                                                                          &imageNdx);
 
                                if (acquireResult == vk::VK_SUBOPTIMAL_KHR)
@@ -1143,7 +1158,7 @@ tcu::TestStatus basicRenderTest (Context& baseCtx, vk::wsi::Type wsiType)
                                };
 
                                renderer.recordFrame(commandBuffer, imageNdx, frameNdx);
-                               VK_CHECK(vkd.queueSubmit(context.getQueue(), 1u, &submitInfo, (vk::VkFence)0));
+                               VK_CHECK(vkd.queueSubmit(context.getQueue(), 1u, &submitInfo, imageReadyFence));
                                VK_CHECK(vkd.queuePresentKHR(context.getQueue(), &presentInfo));
                        }
                }
index 376da74..bc7bfcd 100644 (file)
@@ -359,7 +359,12 @@ void uploadYCbCrImage (ProtectedContext&                                   ctx,
 
        beginCommandBuffer(vk, *cmdBuffer);
 
+       for (deUint32 planeNdx = 0; planeNdx < imageData.getDescription().numPlanes; ++planeNdx)
        {
+               const vk::VkImageAspectFlagBits aspect  = formatDesc.numPlanes > 1
+                                                                                               ? vk::getPlaneAspect(planeNdx)
+                                                                                               : vk::VK_IMAGE_ASPECT_COLOR_BIT;
+
                const vk::VkImageMemoryBarrier          preCopyBarrier  =
                {
                        vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
@@ -371,7 +376,7 @@ void uploadYCbCrImage (ProtectedContext&                                    ctx,
                        queueFamilyIndex,
                        queueFamilyIndex,
                        image,
-                       { vk::VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }
+                       { aspect, 0u, 1u, 0u, 1u }
                };
 
                vk.cmdPipelineBarrier(*cmdBuffer,
@@ -407,7 +412,12 @@ void uploadYCbCrImage (ProtectedContext&                                   ctx,
                vk.cmdCopyBufferToImage(*cmdBuffer, ***stagingBuffers[planeNdx], image, vk::VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1u, &copy);
        }
 
+       for (deUint32 planeNdx = 0; planeNdx < imageData.getDescription().numPlanes; ++planeNdx)
        {
+               const vk::VkImageAspectFlagBits aspect  = formatDesc.numPlanes > 1
+                                                                                               ? vk::getPlaneAspect(planeNdx)
+                                                                                               : vk::VK_IMAGE_ASPECT_COLOR_BIT;
+
                const vk::VkImageMemoryBarrier          postCopyBarrier =
                {
                        vk::VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
@@ -419,7 +429,7 @@ void uploadYCbCrImage (ProtectedContext&                                    ctx,
                        VK_QUEUE_FAMILY_IGNORED,
                        VK_QUEUE_FAMILY_IGNORED,
                        image,
-                       { vk::VK_IMAGE_ASPECT_COLOR_BIT, 0u, 1u, 0u, 1u }
+                       { aspect, 0u, 1u, 0u, 1u }
                };
 
                vk.cmdPipelineBarrier(*cmdBuffer,