aboutsummaryrefslogtreecommitdiff
path: root/layers/image.cpp
diff options
context:
space:
mode:
authorMark Lobodzinski <mark@lunarg.com>2015-11-10 11:01:32 -0700
committerMark Lobodzinski <mark@lunarg.com>2015-11-10 15:49:59 -0700
commit7e711677b9f0a717cedac8c6d9a440e049dff88e (patch)
tree97fa3195e2e5d6ff72a41415f7a81486fef0cbb9 /layers/image.cpp
parent7e825911e286b91e9b715bb530ebd53d551a8a04 (diff)
downloadusermoji-7e711677b9f0a717cedac8c6d9a440e049dff88e.tar.xz
layers: LX190, Image layer doe snot recognize swapchain images
Image layer was using helper function limited only to header definitions, ignoring the WSI extension images for image layouts.
Diffstat (limited to 'layers/image.cpp')
-rw-r--r--layers/image.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/layers/image.cpp b/layers/image.cpp
index 8cf18cba..4c08a833 100644
--- a/layers/image.cpp
+++ b/layers/image.cpp
@@ -255,6 +255,12 @@ bool is_depth_format(VkFormat format)
return result;
}
+static inline uint32_t validate_VkImageLayoutKHR(VkImageLayout input_value)
+{
+ return ((validate_VkImageLayout(input_value) == 1) ||
+ (input_value == VK_IMAGE_LAYOUT_PRESENT_SOURCE_KHR));
+}
+
VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage(VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage)
{
VkBool32 skipCall = VK_FALSE;
@@ -312,8 +318,8 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkCreateRenderPass(VkDevice devic
for(uint32_t i = 0; i < pCreateInfo->attachmentCount; ++i)
{
- if(!validate_VkImageLayout(pCreateInfo->pAttachments[i].initialLayout) ||
- !validate_VkImageLayout(pCreateInfo->pAttachments[i].finalLayout))
+ if(!validate_VkImageLayoutKHR(pCreateInfo->pAttachments[i].initialLayout) ||
+ !validate_VkImageLayoutKHR(pCreateInfo->pAttachments[i].finalLayout))
{
std::stringstream ss;
ss << "vkCreateRenderPass parameter, VkImageLayout in pCreateInfo->pAttachments[" << i << "], is unrecognized";