Fix further aspect masks in renderpass2 tests
authorGraeme Leese <gleese@broadcom.com>
Thu, 13 Dec 2018 11:21:13 +0000 (11:21 +0000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 20 Dec 2018 08:09:31 +0000 (03:09 -0500)
Components: Vulkan
Affects: dEQP-VK.renderpass.suballocation.multisample.*
         dEQP-VK.renderpass2.suballocation.multisample.*

Change-Id: I52262321f00b2f7ffbe47efa4e455c80b6c5d251

external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp

index 6ca9a206c58342905644ee8ac3ead4054760ae77..2994964070c06bf1431bce650253ff5235b584f0 100644 (file)
@@ -464,7 +464,8 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface& vkd,
                                                                         VkDevice                               device,
                                                                         VkFormat                               srcFormat,
                                                                         VkFormat                               dstFormat,
-                                                                        deUint32                               sampleCount)
+                                                                        deUint32                               sampleCount,
+                                                                        RenderPassType                 renderPassType)
 {
        const VkSampleCountFlagBits             samples                                         (sampleCountBitFromomSampleCount(sampleCount));
        const deUint32                                  splitSubpassCount                       (deDivRoundUp32(sampleCount, MAX_COLOR_ATTACHMENT_COUNT));
@@ -491,7 +492,9 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface& vkd,
                DE_NULL,                                                                                                        //                                                                                                                              ||  const void*                                                 pNext;
                0u,                                                                                                                     //  deUint32                                            attachment;                                     ||  deUint32                                                    attachment;
                VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,                                       //  VkImageLayout                                       layout;                                         ||  VkImageLayout                                               layout;
-               0u                                                                                                                      //                                                                                                                              ||  VkImageAspectFlags                                  aspectMask;
+               (renderPassType == RENDERPASS_TYPE_RENDERPASS2)                         //                                                                                                                              ||  VkImageAspectFlags                                  aspectMask;
+                       ? getImageAspectFlags(srcFormat)
+                       : 0u
        );
 
        {
@@ -666,9 +669,9 @@ Move<VkRenderPass> createRenderPass (const DeviceInterface& vkd,
        switch (renderPassType)
        {
                case RENDERPASS_TYPE_LEGACY:
-                       return createRenderPass<AttachmentDescription1, AttachmentReference1, SubpassDescription1, SubpassDependency1, RenderPassCreateInfo1>(vkd, device, srcFormat, dstFormat, sampleCount);
+                       return createRenderPass<AttachmentDescription1, AttachmentReference1, SubpassDescription1, SubpassDependency1, RenderPassCreateInfo1>(vkd, device, srcFormat, dstFormat, sampleCount, renderPassType);
                case RENDERPASS_TYPE_RENDERPASS2:
-                       return createRenderPass<AttachmentDescription2, AttachmentReference2, SubpassDescription2, SubpassDependency2, RenderPassCreateInfo2>(vkd, device, srcFormat, dstFormat, sampleCount);
+                       return createRenderPass<AttachmentDescription2, AttachmentReference2, SubpassDescription2, SubpassDependency2, RenderPassCreateInfo2>(vkd, device, srcFormat, dstFormat, sampleCount, renderPassType);
                default:
                        TCU_THROW(InternalError, "Impossible");
        }