From efff6e216a25b8d63deb2f00c92dfb733277bca7 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 20 Jul 2016 13:27:33 -0600 Subject: layers: Refactor buffer/image validation functions Add some consts and put fwd decls in core_validation_types.h so that these can be used by descriptor_set class. --- layers/core_validation.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'layers/core_validation.cpp') diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 6dc24bfb..8ee80870 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -693,28 +693,28 @@ static bool clear_object_binding(layer_data *dev_data, uint64_t handle, VkDebugR } // Check to see if memory was ever bound to this image -static bool ValidateMemoryIsBoundToImage(layer_data *dev_data, IMAGE_NODE *image_node, const char *api_name) { +bool ValidateMemoryIsBoundToImage(const layer_data *dev_data, const IMAGE_NODE *image_node, const char *api_name) { bool result = false; if (0 == (static_cast(image_node->createInfo.flags) & VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { if (0 == image_node->mem) { result = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_IMAGE_EXT, - reinterpret_cast(image_node->image), __LINE__, MEMTRACK_OBJECT_NOT_BOUND, "MEM", - "%s: VkImage object 0x%" PRIxLEAST64 " used without first calling vkBindImageMemory.", api_name, - reinterpret_cast(image_node->image)); + reinterpret_cast(image_node->image), __LINE__, MEMTRACK_OBJECT_NOT_BOUND, "MEM", + "%s: VkImage object 0x%" PRIxLEAST64 " used without first calling vkBindImageMemory.", api_name, + reinterpret_cast(image_node->image)); } } return result; } // Check to see if memory was bound to this buffer -static bool ValidateMemoryIsBoundToBuffer(layer_data *dev_data, BUFFER_NODE *buffer_node, const char *api_name) { +bool ValidateMemoryIsBoundToBuffer(const layer_data *dev_data, const BUFFER_NODE *buffer_node, const char *api_name) { bool result = false; if (0 == (static_cast(buffer_node->createInfo.flags) & VK_IMAGE_CREATE_SPARSE_BINDING_BIT)) { if (0 == buffer_node->mem) { result = log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, - reinterpret_cast(buffer_node->buffer), __LINE__, MEMTRACK_OBJECT_NOT_BOUND, "MEM", - "%s: VkBuffer object 0x%" PRIxLEAST64 " used without first calling vkBindBufferMemory.", api_name, - reinterpret_cast(buffer_node->buffer)); + reinterpret_cast(buffer_node->buffer), __LINE__, MEMTRACK_OBJECT_NOT_BOUND, "MEM", + "%s: VkBuffer object 0x%" PRIxLEAST64 " used without first calling vkBindBufferMemory.", api_name, + reinterpret_cast(buffer_node->buffer)); } } return result; -- cgit v1.2.3