diff options
| author | Jeremy Kniager <jeremyk@lunarg.com> | 2018-01-19 10:55:01 -0700 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2018-03-01 09:39:02 -0700 |
| commit | be11b7ca84093dc6b2f44ecbae4cb4c9f3b4ecff (patch) | |
| tree | 17b3ad2bd70adf96ee9bc1f9c700adbcb98e56a7 /layers/core_validation.cpp | |
| parent | 602e418f5ace55b7fc67531bd1fada3a2a54ca83 (diff) | |
| download | usermoji-be11b7ca84093dc6b2f44ecbae4cb4c9f3b4ecff.tar.xz | |
layers: Add VU check for VkSwapchainCreateInfoKHR
Added validation check for zero values in
imageExtent of VkSwapchainCreateInfoKHR.
No test included for this VU check as there is
currently no clean method for creating a
VkSurfaceKHR object in
layer_validation_tests.cpp.
Change-Id: I5b04543a837d1f1f7d8c20cec4f446df503a81ce
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index e34f0cc9..d88ef476 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -10118,6 +10118,15 @@ static bool PreCallValidateCreateSwapchainKHR(layer_data *dev_data, const char * "%s: pCreateInfo->oldSwapchain's surface is not pCreateInfo->surface", func_name)) return true; } + + if ((pCreateInfo->imageExtent.width == 0) || (pCreateInfo->imageExtent.height == 0)) { + if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT, + HandleToUint64(dev_data->device), __LINE__, VALIDATION_ERROR_14600d32, "DS", + "%s: pCreateInfo->imageExtent = (%d, %d) which is illegal. %s", func_name, pCreateInfo->imageExtent.width, + pCreateInfo->imageExtent.height, validation_error_map[VALIDATION_ERROR_14600d32])) + return true; + } + auto physical_device_state = GetPhysicalDeviceState(dev_data->instance_data, dev_data->physical_device); if (physical_device_state->vkGetPhysicalDeviceSurfaceCapabilitiesKHRState == UNCALLED) { if (log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT, |
