From: Jason Ekstrand Date: Fri, 11 Feb 2022 00:20:08 +0000 (-0600) Subject: Use the correct stencilInitialLayout for unused resolve targets with separate stencil X-Git-Tag: upstream/1.3.5~332^2~3^2~5^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=028f8afadf0731088571438d03fbaceba70a881c;p=platform%2Fupstream%2FVK-GL-CTS.git Use the correct stencilInitialLayout for unused resolve targets with separate stencil The initial stencil layout was always being specified as UNDEFINED even though, in the unused resolve target case, we clear it with vkCmdClearDepthStencilImage() and need an initial layout of TRANSFER_SRC_OPTIMAL. Components: Vulkan Affects: dEQP-VK.renderpass2.depth_stencil_resolve.*separate_layouts.* Change-Id: Id0e0dcd2066d02758875a786c5634b23c893f7a2 --- diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp index 77b8d4d..730b7c6 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp @@ -447,14 +447,22 @@ Move DepthStencilResolveTest::createRenderPass(VkFormat vkformat, }; void * attachmentRefStencil = DE_NULL; VkImageLayout finalLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; - VkAttachmentDescriptionStencilLayoutKHR stencilFinalLayout = + VkAttachmentDescriptionStencilLayoutKHR multisampleStencilFinalLayout = { VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR, DE_NULL, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, }; - void * attachmentDescriptionStencil = DE_NULL; + VkAttachmentDescriptionStencilLayoutKHR singlesampleStencilFinalLayout = + { + VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR, + DE_NULL, + VK_IMAGE_LAYOUT_UNDEFINED, + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + }; + void * multisampleAttachmentDescriptionStencil = DE_NULL; + void * singlesampleAttachmentDescriptionStencil = DE_NULL; if (m_config.separateDepthStencilLayouts) { @@ -463,34 +471,39 @@ Move DepthStencilResolveTest::createRenderPass(VkFormat vkformat, layout = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_OPTIMAL_KHR; stencilLayout.stencilLayout = VK_IMAGE_LAYOUT_GENERAL; finalLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; - stencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR; // This aspect should be unused. + multisampleStencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR; // This aspect should be unused. + singlesampleStencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR; // This aspect should be unused. } else { layout = m_config.sampleMask ? VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR : VK_IMAGE_LAYOUT_GENERAL; stencilLayout.stencilLayout = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR; finalLayout = VK_IMAGE_LAYOUT_GENERAL; // This aspect should be unused. - stencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; + multisampleStencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; + singlesampleStencilFinalLayout.stencilFinalLayout = VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL; } attachmentRefStencil = &stencilLayout; - attachmentDescriptionStencil = &stencilFinalLayout; + multisampleAttachmentDescriptionStencil = &multisampleStencilFinalLayout; + singlesampleAttachmentDescriptionStencil = &singlesampleStencilFinalLayout; } if (renderPassNo != 0) { - stencilFinalLayout.stencilInitialLayout = stencilLayout.stencilLayout; + multisampleStencilFinalLayout.stencilInitialLayout = stencilLayout.stencilLayout; + singlesampleStencilFinalLayout.stencilInitialLayout = stencilLayout.stencilLayout; } if (renderPassNo != m_numRenderPasses - 1) { finalLayout = layout; - stencilFinalLayout.stencilFinalLayout = layout; + multisampleStencilFinalLayout.stencilFinalLayout = layout; + singlesampleStencilFinalLayout.stencilFinalLayout = layout; } const AttachmentDescription2 multisampleAttachment // VkAttachmentDescription2 ( // VkStructureType sType; - attachmentDescriptionStencil, // const void* pNext; + multisampleAttachmentDescriptionStencil, // const void* pNext; 0u, // VkAttachmentDescriptionFlags flags; m_config.format, // VkFormat format; samples, // VkSampleCountFlagBits samples; @@ -513,6 +526,8 @@ Move DepthStencilResolveTest::createRenderPass(VkFormat vkformat, vk::VkImageLayout singleSampleInitialLayout = (m_config.unusedResolve ? VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL : VK_IMAGE_LAYOUT_UNDEFINED); if (renderPassNo != 0) singleSampleInitialLayout = layout; + if (m_config.separateDepthStencilLayouts && m_config.verifyBuffer == VB_STENCIL) + singlesampleStencilFinalLayout.stencilInitialLayout = singleSampleInitialLayout; const tcu::TextureFormat format (mapVkFormat(vkformat)); VkImageAspectFlags aspectFlags = @@ -522,7 +537,7 @@ Move DepthStencilResolveTest::createRenderPass(VkFormat vkformat, const AttachmentDescription2 singlesampleAttachment // VkAttachmentDescription2 ( // VkStructureType sType; - attachmentDescriptionStencil, // const void* pNext; + singlesampleAttachmentDescriptionStencil, // const void* pNext; 0u, // VkAttachmentDescriptionFlags flags; vkformat, // VkFormat format; VK_SAMPLE_COUNT_1_BIT, // VkSampleCountFlagBits samples;