diff options
| author | Chris Forbes <chrisforbes@google.com> | 2016-11-02 17:43:34 +1300 |
|---|---|---|
| committer | Chris Forbes <chrisforbes@google.com> | 2016-11-07 15:25:05 +1300 |
| commit | 4f4713af5a2dddf885b4a006a39c1c39bee6fff0 (patch) | |
| tree | 2b4d05e65ea4c2731aa0e7323643bf6da5bdc0d8 /layers/parameter_validation.cpp | |
| parent | 410fd952fe44ab00c05022b59c2289d3ce761edc (diff) | |
| download | usermoji-4f4713af5a2dddf885b4a006a39c1c39bee6fff0.tar.xz | |
layers: Move enable checks for KHR_surface to PV
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Diffstat (limited to 'layers/parameter_validation.cpp')
| -rw-r--r-- | layers/parameter_validation.cpp | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/layers/parameter_validation.cpp b/layers/parameter_validation.cpp index fe6f9255..5169e94d 100644 --- a/layers/parameter_validation.cpp +++ b/layers/parameter_validation.cpp @@ -4820,6 +4820,15 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevi layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); assert(my_data != NULL); + if (!instance_extension_map[get_dispatch_table(pc_instance_table_map, physicalDevice)].surface_enabled) { + skip_call |= log_msg( + my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + reinterpret_cast<uint64_t>(physicalDevice), __LINE__, EXTENSION_NOT_ENABLED, + LayerName, + "vkGetPhysicalDeviceSurfaceSupportKHR() called even though the %s extension was not enabled for this VkInstance.", + VK_KHR_SURFACE_EXTENSION_NAME); + } + skip_call |= parameter_validation_vkGetPhysicalDeviceSurfaceSupportKHR(my_data->report_data, queueFamilyIndex, surface, pSupported); @@ -4840,6 +4849,15 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysica layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); assert(my_data != NULL); + if (!instance_extension_map[get_dispatch_table(pc_instance_table_map, physicalDevice)].surface_enabled) { + skip_call |= log_msg( + my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + reinterpret_cast<uint64_t>(physicalDevice), __LINE__, EXTENSION_NOT_ENABLED, + LayerName, + "vkGetPhysicalDeviceSurfaceCapabilitiesKHR() called even though the %s extension was not enabled for this VkInstance.", + VK_KHR_DISPLAY_EXTENSION_NAME); + } + skip_call |= parameter_validation_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(my_data->report_data, surface, pSurfaceCapabilities); @@ -4861,6 +4879,15 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfaceFormatsKHR(VkPhysicalDevi layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); assert(my_data != NULL); + if (!instance_extension_map[get_dispatch_table(pc_instance_table_map, physicalDevice)].surface_enabled) { + skip_call |= log_msg( + my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + reinterpret_cast<uint64_t>(physicalDevice), __LINE__, EXTENSION_NOT_ENABLED, + LayerName, + "vkGetPhysicalDeviceSurfaceFormatsKHR() called even though the %s extension was not enabled for this VkInstance.", + VK_KHR_DISPLAY_EXTENSION_NAME); + } + skip_call |= parameter_validation_vkGetPhysicalDeviceSurfaceFormatsKHR(my_data->report_data, surface, pSurfaceFormatCount, pSurfaceFormats); @@ -4882,6 +4909,15 @@ VKAPI_ATTR VkResult VKAPI_CALL GetPhysicalDeviceSurfacePresentModesKHR(VkPhysica layer_data *my_data = get_my_data_ptr(get_dispatch_key(physicalDevice), layer_data_map); assert(my_data != NULL); + if (!instance_extension_map[get_dispatch_table(pc_instance_table_map, physicalDevice)].surface_enabled) { + skip_call |= log_msg( + my_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, + reinterpret_cast<uint64_t>(physicalDevice), __LINE__, EXTENSION_NOT_ENABLED, + LayerName, + "vkGetPhysicalDeviceSurfacePresentModesKHR() called even though the %s extension was not enabled for this VkInstance.", + VK_KHR_DISPLAY_EXTENSION_NAME); + } + skip_call |= parameter_validation_vkGetPhysicalDeviceSurfacePresentModesKHR(my_data->report_data, surface, pPresentModeCount, pPresentModes); @@ -5607,12 +5643,9 @@ static PFN_vkVoidFunction InterceptWsiEnabledCommand(const char *name, VkInstanc reinterpret_cast<PFN_vkVoidFunction>(GetPhysicalDeviceSurfacePresentModesKHR)}, }; - VkLayerInstanceDispatchTable *pTable = get_dispatch_table(pc_instance_table_map, instance); - if (instance_extension_map[pTable].surface_enabled) { - for (size_t i = 0; i < ARRAY_SIZE(wsi_instance_commands); i++) { - if (!strcmp(wsi_instance_commands[i].name, name)) - return wsi_instance_commands[i].proc; - } + for (size_t i = 0; i < ARRAY_SIZE(wsi_instance_commands); i++) { + if (!strcmp(wsi_instance_commands[i].name, name)) + return wsi_instance_commands[i].proc; } #ifdef VK_USE_PLATFORM_WIN32_KHR |
