From b25a8ac0588042daee94f911578047113a9f3b14 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Fri, 7 Jul 2017 12:05:28 -0600 Subject: layers: GH1933, Check for mutually exclusive exts Add check for Maintenance1 and negative_viewport_height extensions being enabled simultaneously, along with test and a database update. Change-Id: Id44f2a322fd32883d8b6d7ff1dab56996dec76c7 --- layers/parameter_validation.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'layers/parameter_validation.cpp') diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index e5a12941..c0f81d18 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -438,13 +438,27 @@ static bool ValidateDeviceCreateInfo(instance_layer_data *instance_data, VkPhysi } } + bool maint1 = false; + bool negative_viewport = false; + if ((pCreateInfo->enabledExtensionCount > 0) && (pCreateInfo->ppEnabledExtensionNames != NULL)) { for (size_t i = 0; i < pCreateInfo->enabledExtensionCount; i++) { skip |= validate_string(instance_data->report_data, "vkCreateDevice", "pCreateInfo->ppEnabledExtensionNames", pCreateInfo->ppEnabledExtensionNames[i]); + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_MAINTENANCE1_EXTENSION_NAME) == 0) maint1 = true; + if (strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_AMD_NEGATIVE_VIEWPORT_HEIGHT_EXTENSION_NAME) == 0) + negative_viewport = true; } } + if (maint1 && negative_viewport) { + skip |= log_msg(instance_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT, 0, + __LINE__, VALIDATION_ERROR_056002ec, LayerName, + "VkDeviceCreateInfo->ppEnabledExtensionNames must not simultaneously include VK_KHR_maintenance1 and " + "VK_AMD_negative_viewport_height. %s", + validation_error_map[VALIDATION_ERROR_056002ec]); + } + if (pCreateInfo->pNext != NULL && pCreateInfo->pEnabledFeatures) { // Check for get_physical_device_properties2 struct struct std_header { -- cgit v1.2.3