diff options
| author | Thomas Louis <thomaslouis81@gmail.com> | 2017-01-11 00:17:08 +0100 |
|---|---|---|
| committer | Mark Lobodzinski <mark@lunarg.com> | 2017-01-18 20:42:12 -0700 |
| commit | aef8f2aa8534a48ba1898b5fd712c82970c30afd (patch) | |
| tree | 297f7e816a93957a174e9cfe339cd55c9b46e774 /layers/core_validation.cpp | |
| parent | 5be2fd16eab8b5d7596ed55df5490e617a41ee0e (diff) | |
| download | usermoji-aef8f2aa8534a48ba1898b5fd712c82970c30afd.tar.xz | |
layers: GH1355, Fix bad swapchain image accesses
vkAcquireNextImageKHR throws Access Violation Exception. Added a new
error enum value and created an error check in vkAcquireNextImageKHR
to avoid index out of bounds exception (thrown in core_validation)
within the application.
Change-Id: Ie7fe2d3830e26c21b09290054cc39bc55e534cbc
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 4087178c..2db93ba7 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -12413,6 +12413,14 @@ VKAPI_ATTR VkResult VKAPI_CALL AcquireNextImageKHR(VkDevice device, VkSwapchainK acquired_images); } } + + if (swapchain_data->images.size() == 0) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_SWAPCHAIN_KHR_EXT, + reinterpret_cast<uint64_t const &>(swapchain), __LINE__, DRAWSTATE_SWAPCHAIN_IMAGES_NOT_FOUND, "DS", + "vkAcquireNextImageKHR: No images found to acquire from. Application probably did not call " + "vkGetSwapchainImagesKHR after swapchain creation."); + } + lock.unlock(); if (skip_call) |
