Add test checking depth/stencil resolve properties
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 14 Nov 2019 09:47:45 +0000 (10:47 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Mon, 2 Dec 2019 10:38:06 +0000 (05:38 -0500)
Check VkPhysicalDeviceDepthStencilResolvePropertiesKHR values according
to the spec.

New tests:
dEQP-VK.renderpass2.depth_stencil_resolve.misc.properties

Components: Vulkan
VK-GL-CTS issue: 2089

Change-Id: I58bbf7a2d492a459cac35a213d10c144843bfd05

android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/renderpass/vktRenderPassDepthStencilResolveTests.cpp
external/vulkancts/mustpass/master/vk-default-no-waivers.txt
external/vulkancts/mustpass/master/vk-default.txt

index f58dc47..a5f32a5 100644 (file)
@@ -365277,6 +365277,7 @@ dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_5
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_6
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_7
+dEQP-VK.renderpass2.depth_stencil_resolve.misc.properties
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_unused_resolve_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_zero_testing_depth
index db7e81f..e147eac 100644 (file)
@@ -1154,6 +1154,68 @@ struct Programs
        }
 };
 
+class PropertiesTestCase : public vkt::TestCase
+{
+public:
+                                                       PropertiesTestCase              (tcu::TestContext& testCtx, const std::string& name, const std::string& description)
+                                                               : vkt::TestCase(testCtx, name, description)
+                                                               {}
+       virtual                                 ~PropertiesTestCase             (void) {}
+
+       virtual TestInstance*   createInstance                  (Context& context) const;
+       virtual void                    checkSupport                    (Context& context) const;
+};
+
+class PropertiesTestInstance : public vkt::TestInstance
+{
+public:
+                                                               PropertiesTestInstance  (Context& context)
+                                                                       : vkt::TestInstance(context)
+                                                                       {}
+       virtual                                         ~PropertiesTestInstance (void) {}
+
+       virtual tcu::TestStatus         iterate                                 (void);
+
+};
+
+TestInstance* PropertiesTestCase::createInstance (Context& context) const
+{
+       return new PropertiesTestInstance(context);
+}
+
+void PropertiesTestCase::checkSupport (Context& context) const
+{
+       context.requireDeviceFunctionality("VK_KHR_depth_stencil_resolve");
+}
+
+tcu::TestStatus PropertiesTestInstance::iterate (void)
+{
+       vk::VkPhysicalDeviceDepthStencilResolvePropertiesKHR dsrProperties;
+       dsrProperties.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR;
+       dsrProperties.pNext = nullptr;
+
+       vk::VkPhysicalDeviceProperties2 properties2;
+       properties2.sType = vk::VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+       properties2.pNext = &dsrProperties;
+
+       m_context.getInstanceInterface().getPhysicalDeviceProperties2(m_context.getPhysicalDevice(), &properties2);
+
+       if ((dsrProperties.supportedDepthResolveModes & vk::VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR) == 0)
+               TCU_FAIL("supportedDepthResolveModes does not include VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR");
+
+       if ((dsrProperties.supportedStencilResolveModes & vk::VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR) == 0)
+               TCU_FAIL("supportedStencilResolveModes does not include VK_RESOLVE_MODE_SAMPLE_ZERO_BIT_KHR");
+
+       if ((dsrProperties.supportedStencilResolveModes & vk::VK_RESOLVE_MODE_AVERAGE_BIT_KHR) != 0)
+               TCU_FAIL("supportedStencilResolveModes includes forbidden VK_RESOLVE_MODE_AVERAGE_BIT_KHR");
+
+       if (dsrProperties.independentResolve == VK_TRUE && dsrProperties.independentResolveNone != VK_TRUE)
+               TCU_FAIL("independentResolve supported but independentResolveNone not supported");
+
+       return tcu::TestStatus::pass("Pass");
+}
+
+
 void initTests (tcu::TestCaseGroup* group)
 {
        typedef InstanceFactory1<DepthStencilResolveTest, TestConfig, Programs> DSResolveTestInstance;
@@ -1239,6 +1301,13 @@ void initTests (tcu::TestCaseGroup* group)
 
        tcu::TestContext& testCtx(group->getTestContext());
 
+       // Misc tests.
+       {
+               de::MovePtr<tcu::TestCaseGroup> miscGroup(new tcu::TestCaseGroup(testCtx, "misc", "Miscellaneous depth/stencil resolve tests"));
+               miscGroup->addChild(new PropertiesTestCase(testCtx, "properties", "Check reported depth/stencil resolve properties"));
+               group->addChild(miscGroup.release());
+       }
+
        // iterate over image data
        for      (deUint32 imageDataNdx = 0; imageDataNdx < DE_LENGTH_OF_ARRAY(imagesTestData); imageDataNdx++)
        {
index 2c19ed3..8f4cf13 100644 (file)
@@ -365292,6 +365292,7 @@ dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_5
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_6
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_7
+dEQP-VK.renderpass2.depth_stencil_resolve.misc.properties
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_unused_resolve_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_zero_testing_depth
index 1390b8e..23dce48 100644 (file)
@@ -365254,6 +365254,7 @@ dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_5
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_6
 dEQP-VK.renderpass2.dedicated_allocation.attachment_write_mask.attachment_count_8.start_index_7
+dEQP-VK.renderpass2.depth_stencil_resolve.misc.properties
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_none_unused_resolve_testing_depth
 dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d16_unorm.depth_zero_stencil_zero_testing_depth