From 4f0cdcd7095670456296cf8e06f973193dbda044 Mon Sep 17 00:00:00 2001 From: Pyry Haulos Date: Tue, 17 Jan 2017 15:49:02 -0800 Subject: [PATCH] Android: Test that no Vulkan layers are enumerated Change-Id: I43dacf306b468485fc160f175160555b9cf1c86d --- android/cts/master/vk-master.txt | 1 + .../modules/vulkan/api/vktApiFeatureInfo.cpp | 23 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/android/cts/master/vk-master.txt b/android/cts/master/vk-master.txt index 27db6c7..41bd9b9 100644 --- a/android/cts/master/vk-master.txt +++ b/android/cts/master/vk-master.txt @@ -3521,6 +3521,7 @@ 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.no_unknown_extensions +dEQP-VK.api.info.android.no_layers dEQP-VK.api.device_init.create_instance_name_version dEQP-VK.api.device_init.create_instance_invalid_api_version dEQP-VK.api.device_init.create_instance_null_appinfo diff --git a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp index 0096c89..ec0869f 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp @@ -2614,6 +2614,28 @@ tcu::TestStatus testNoUnknownExtensions (Context& context) return tcu::TestStatus(results.getResult(), results.getMessage()); } +tcu::TestStatus testNoLayers (Context& context) +{ + TestLog& log = context.getTestContext().getLog(); + tcu::ResultCollector results (log); + + { + const vector layers = enumerateInstanceLayerProperties(context.getPlatformInterface()); + + for (vector::const_iterator layer = layers.begin(); layer != layers.end(); ++layer) + results.fail(string("Instance layer enumerated: ") + layer->layerName); + } + + { + const vector layers = enumerateDeviceLayerProperties(context.getInstanceInterface(), context.getPhysicalDevice()); + + for (vector::const_iterator layer = layers.begin(); layer != layers.end(); ++layer) + results.fail(string("Device layer enumerated: ") + layer->layerName); + } + + return tcu::TestStatus(results.getResult(), results.getMessage()); +} + } // android } // anonymous @@ -2667,6 +2689,7 @@ tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx) de::MovePtr androidTests (new tcu::TestCaseGroup(testCtx, "android", "Android CTS Tests")); 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); infoTests->addChild(androidTests.release()); } -- 2.7.4