Android: Test that mandatory extensions are supported
authorPyry Haulos <phaulos@google.com>
Fri, 3 Feb 2017 21:25:48 +0000 (13:25 -0800)
committerPyry Haulos <phaulos@google.com>
Fri, 3 Feb 2017 21:29:38 +0000 (13:29 -0800)
Change-Id: Id0e44299f1d8441bf1e7ecc91d82d3b06400e7e6

android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp

index 41bd9b9c55311c0bbf304bbbfeab4e7ccf7ba4fa..70940781f32e8604c784e4cd28385b7d6c75c6c1 100644 (file)
@@ -3520,6 +3520,7 @@ dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x10_unorm_bloc
 dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x10_srgb_block
 dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x12_unorm_block
 dEQP-VK.api.info.sparse_image_format_properties2.3d.linear.astc_12x12_srgb_block
+dEQP-VK.api.info.android.mandatory_extensions
 dEQP-VK.api.info.android.no_unknown_extensions
 dEQP-VK.api.info.android.no_layers
 dEQP-VK.api.device_init.create_instance_name_version
index ec0869f94f6589bda743b900407f825a19ae7ab1..8b98f08276d7e93f5570861447195016dfaec9a3 100644 (file)
@@ -2636,6 +2636,44 @@ tcu::TestStatus testNoLayers (Context& context)
        return tcu::TestStatus(results.getResult(), results.getMessage());
 }
 
+tcu::TestStatus testMandatoryExtensions (Context& context)
+{
+       TestLog&                                log             = context.getTestContext().getLog();
+       tcu::ResultCollector    results (log);
+
+       // Instance extensions
+       {
+               static const char*                                      mandatoryExtensions[]   =
+               {
+                       "VK_KHR_get_physical_device_properties2",
+               };
+               const vector<VkExtensionProperties>     extensions                              = enumerateInstanceExtensionProperties(context.getPlatformInterface(), DE_NULL);
+
+               for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+               {
+                       if (!isExtensionSupported(extensions, RequiredExtension(mandatoryExtensions[ndx])))
+                               results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+               }
+       }
+
+       // Device extensions
+       {
+               static const char*                                      mandatoryExtensions[]   =
+               {
+                       "VK_KHR_maintenance1",
+               };
+               const vector<VkExtensionProperties>     extensions                              = enumerateDeviceExtensionProperties(context.getInstanceInterface(), context.getPhysicalDevice(), DE_NULL);
+
+               for (int ndx = 0; ndx < DE_LENGTH_OF_ARRAY(mandatoryExtensions); ++ndx)
+               {
+                       if (!isExtensionSupported(extensions, RequiredExtension(mandatoryExtensions[ndx])))
+                               results.fail(string(mandatoryExtensions[ndx]) + " is not supported");
+               }
+       }
+
+       return tcu::TestStatus(results.getResult(), results.getMessage());
+}
+
 } // android
 
 } // anonymous
@@ -2688,6 +2726,7 @@ tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx)
        {
                de::MovePtr<tcu::TestCaseGroup> androidTests    (new tcu::TestCaseGroup(testCtx, "android", "Android CTS Tests"));
 
+               addFunctionCase(androidTests.get(),     "mandatory_extensions",         "Test that all mandatory extensions are supported",     android::testMandatoryExtensions);
                addFunctionCase(androidTests.get(), "no_unknown_extensions",    "Test for unknown device or instance extensions",       android::testNoUnknownExtensions);
                addFunctionCase(androidTests.get(), "no_layers",                                "Test that no layers are enumerated",                           android::testNoLayers);