From 38b816636c14b30fe07a3d90238b570d26c3dd96 Mon Sep 17 00:00:00 2001 From: Piers Daniell Date: Thu, 20 Jul 2017 15:53:13 -0600 Subject: [PATCH] Clear the stencil attachment if it exists The test uses VK_STENCIL_OP_INCREMENT_AND_WRAP which needs the stencil attachment in a known state in order to produce predictable results. Affects: dEQP-VK.renderpass.suballocation.multisample.s8_uint.samples_* dEQP-VK.renderpass.suballocation.multisample.d16_unorm_s8_uint.samples_* dEQP-VK.renderpass.suballocation.multisample.d24_unorm_s8_uint.samples_* dEQP-VK.renderpass.suballocation.multisample.d32_sfloat_s8_uint.samples_* dEQP-VK.renderpass.multisample.s8_uint.samples_* dEQP-VK.renderpass.multisample.d16_unorm_s8_uint.samples_* dEQP-VK.renderpass.multisample.d24_unorm_s8_uint.samples_* dEQP-VK.renderpass.multisample.d32_sfloat_s8_uint.samples_* Components: Vulkan VK-GL-CTS issue: 584 Change-Id: I7ed5ced8b77a4563301320e50b2c247e95c34936 --- .../renderpass/vktRenderPassMultisampleTests.cpp | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp index ed5063b..1256fe7 100644 --- a/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp +++ b/external/vulkancts/modules/vulkan/renderpass/vktRenderPassMultisampleTests.cpp @@ -1462,6 +1462,29 @@ tcu::TestStatus MultisampleRenderPassTestInstance::iterate (void) DE_NULL }; vkd.cmdBeginRenderPass(*commandBuffer, &beginInfo, VK_SUBPASS_CONTENTS_INLINE); + + // Stencil needs to be cleared if it exists. + if (tcu::hasStencilComponent(mapVkFormat(m_srcFormat).order)) + { + const VkClearAttachment clearAttachment = + { + VK_IMAGE_ASPECT_STENCIL_BIT, // VkImageAspectFlags aspectMask; + 0, // deUint32 colorAttachment; + makeClearValueDepthStencil(0, 0) // VkClearValue clearValue; + }; + + const VkClearRect clearRect = + { + { + { 0u, 0u }, + { m_width, m_height } + }, + 0, // deUint32 baseArrayLayer; + 1 // deUint32 layerCount; + }; + + vkd.cmdClearAttachments(*commandBuffer, 1, &clearAttachment, 1, &clearRect); + } } vkd.cmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_renderPipeline); -- 2.7.4