aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Zulauf <jzulauf@LunarG.com>2018-04-16 10:53:32 -0600
committerJohn Zulauf <32470354+jzulauf-lunarg@users.noreply.github.com>2018-04-25 15:15:22 -0600
commit933b93d70b6224ce36d0d2f157d2882b32c4254c (patch)
tree3f4703d706e3b8e439abe3a6a7070b235862bcab
parentdc424c61b0b5bd6b9751f0da8d8e8d882a88094c (diff)
downloadvulkan-validation-layers-933b93d70b6224ce36d0d2f157d2882b32c4254c.tar.gz
tests: Fixed extension dependency in layer tests
Additional validation checks (in subsequent commit) exposed two extension dependency errors. Platform specific surface extensions were specified with specifying the base extension -- but were unneeded and deleted. The external memory capabilities extensions was missing from and external memory validation test in one case, and extension support was not fully tested in another. Change-Id: Id0ae8ec039e8e1a937accee3b7795f9d02abe9ed
-rw-r--r--tests/layer_validation_tests.cpp51
1 files changed, 35 insertions, 16 deletions
diff --git a/tests/layer_validation_tests.cpp b/tests/layer_validation_tests.cpp
index 580096aed..ac3ed33dd 100644
--- a/tests/layer_validation_tests.cpp
+++ b/tests/layer_validation_tests.cpp
@@ -485,12 +485,6 @@ class VkLayerTest : public VkRenderFramework {
// Add default instance extensions to the list
m_instance_extension_names.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
-#ifdef _WIN32
- m_instance_extension_names.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME);
-#endif
-#ifdef VK_USE_PLATFORM_XCB_KHR
- m_instance_extension_names.push_back(VK_KHR_XCB_SURFACE_EXTENSION_NAME);
-#endif
// Use Threading layer first to protect others from
// ThreadCommandBufferCollision test
@@ -12216,6 +12210,17 @@ TEST_F(VkLayerTest, InvalidBarrierQueueFamily) {
TEST_F(VkLayerTest, InvalidBarrierQueueFamilyWithMemExt) {
TEST_DESCRIPTION("Create and submit barriers with invalid queue families when memory extension is enabled ");
+ std::vector<const char *> reqd_instance_extensions = {
+ {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME}};
+ for (auto extension_name : reqd_instance_extensions) {
+ if (InstanceExtensionSupported(extension_name)) {
+ m_instance_extension_names.push_back(extension_name);
+ } else {
+ printf(" Required instance extension %s not supported, skipping test\n", extension_name);
+ return;
+ }
+ }
+
ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));
// Check for external memory device extensions
if (DeviceExtensionSupported(gpu(), nullptr, VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME)) {
@@ -22975,6 +22980,16 @@ TEST_F(VkLayerTest, DescriptorIndexingSetLayoutWithoutExtension) {
TEST_F(VkLayerTest, DescriptorIndexingSetLayout) {
TEST_DESCRIPTION("Exercise various create/allocate-time errors related to VK_EXT_descriptor_indexing.");
+ std::array<const char *, 2> reqd_instance_extensions = {
+ {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_MAINTENANCE3_EXTENSION_NAME}};
+ for (auto instance_ext : reqd_instance_extensions) {
+ if (InstanceExtensionSupported(instance_ext)) {
+ m_instance_extension_names.push_back(instance_ext);
+ } else {
+ printf(" Did not find required instance extension %s; skipped.\n", instance_ext);
+ return;
+ }
+ }
ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));
if (DeviceExtensionSupported(gpu(), nullptr, VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME)) {
m_device_extension_names.push_back(VK_EXT_DESCRIPTOR_INDEXING_EXTENSION_NAME);
@@ -28501,21 +28516,25 @@ TEST_F(VkPositiveLayerTest, ExternalMemory) {
TEST_DESCRIPTION("Perform a copy through a pair of buffers linked by external memory");
#ifdef _WIN32
- const auto extension_name = VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME;
+ const auto ext_mem_extension_name = VK_KHR_EXTERNAL_MEMORY_WIN32_EXTENSION_NAME;
const auto handle_type = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
#else
- const auto extension_name = VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME;
+ const auto ext_mem_extension_name = VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME;
const auto handle_type = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;
#endif
// Check for external memory instance extensions
- if (InstanceExtensionSupported(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME)) {
- m_instance_extension_names.push_back(VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME);
- m_instance_extension_names.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
- } else {
- printf(" External memory extension not supported, skipping test\n");
- return;
+ std::vector<const char *> reqd_instance_extensions = {
+ {VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME, VK_KHR_EXTERNAL_MEMORY_CAPABILITIES_EXTENSION_NAME}};
+ for (auto extension_name : reqd_instance_extensions) {
+ if (InstanceExtensionSupported(extension_name)) {
+ m_instance_extension_names.push_back(extension_name);
+ } else {
+ printf(" Required instance extension %s not supported, skipping test\n", extension_name);
+ return;
+ }
}
+
ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));
// Check for import/export capability
@@ -28547,8 +28566,8 @@ TEST_F(VkPositiveLayerTest, ExternalMemory) {
}
// Check for external memory device extensions
- if (DeviceExtensionSupported(gpu(), nullptr, extension_name)) {
- m_device_extension_names.push_back(extension_name);
+ if (DeviceExtensionSupported(gpu(), nullptr, ext_mem_extension_name)) {
+ m_device_extension_names.push_back(ext_mem_extension_name);
m_device_extension_names.push_back(VK_KHR_EXTERNAL_MEMORY_EXTENSION_NAME);
} else {
printf(" External memory extension not supported, skipping test\n");