From 98183b83386f7b6aeab80c312d4989793001d747 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Thu, 11 May 2017 08:52:51 -0600 Subject: layers: Validate shared presentable image cases Add validation support for shared presentable images as defined in VK_KHR_shared_presentable_image extension. For all uses of shared presentable images, make sure that the image is appropriately in VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout. For two cases where no layout validation was performed, added a TODO note (vkCmdBlitImage, vkCmdResolveImage) as basic layout validation should first be added upstream. Also locked the layout in the case where a front-buffered image is presented and then flag an error if an attempt is made to transition the image layout after that point. Change-Id: I06cda727e3a7f56ccff4bffd7503b5ff73e8a795 --- layers/buffer_validation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'layers/buffer_validation.cpp') diff --git a/layers/buffer_validation.cpp b/layers/buffer_validation.cpp index 2156bc99..f9104751 100644 --- a/layers/buffer_validation.cpp +++ b/layers/buffer_validation.cpp @@ -900,8 +900,9 @@ bool VerifyClearImageLayout(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IM } } else if (VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR == dest_image_layout) { if (!GetDeviceExtensions(device_data)->khr_shared_presentable_image) { + // TODO: Add unique error id when available. skip |= log_msg(report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(image_state->image), __LINE__, 0, "DS", + HandleToUint64(image_state->image), __LINE__, 0, "DS", "Must enable VK_KHR_shared_presentable_image extension before creating images with a layout type " "of VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR."); @@ -909,7 +910,7 @@ bool VerifyClearImageLayout(layer_data *device_data, GLOBAL_CB_NODE *cb_node, IM if (image_state->shared_presentable) { skip |= log_msg( report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(image_state->image), __LINE__, 0, "DS", + HandleToUint64(image_state->image), __LINE__, 0, "DS", "Layout for shared presentable cleared image is %s but can only be VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR.", string_VkImageLayout(dest_image_layout)); } -- cgit v1.2.3