From: Chris Forbes Date: Tue, 4 Oct 2016 22:33:23 +0000 (+1300) Subject: layers: Unify two generic object structs X-Git-Tag: upstream/1.1.92~2401 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb9bf1809168d55d88f5f3a0dda6659c73b83ab5;p=platform%2Fupstream%2FVulkan-Tools.git layers: Unify two generic object structs Signed-off-by: Chris Forbes --- diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index 8fef5c5..69012af 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -195,21 +195,6 @@ class IMAGE_VIEW_STATE : public BASE_NODE { IMAGE_VIEW_STATE(const IMAGE_VIEW_STATE &rh_obj) = delete; }; -// Simple struct to hold handle and type of object so they can be uniquely identified and looked up in appropriate map -// TODO : Unify this with VK_OBJECT above -struct MT_OBJ_HANDLE_TYPE { - uint64_t handle; - VkDebugReportObjectTypeEXT type; -}; - -inline bool operator==(MT_OBJ_HANDLE_TYPE a, MT_OBJ_HANDLE_TYPE b) NOEXCEPT { return a.handle == b.handle && a.type == b.type; } - -namespace std { -template <> struct hash { - size_t operator()(MT_OBJ_HANDLE_TYPE obj) const NOEXCEPT { return hash()(obj.handle) ^ hash()(obj.type); } -}; -} - struct MemRange { VkDeviceSize offset; VkDeviceSize size; @@ -234,7 +219,7 @@ struct DEVICE_MEM_INFO : public BASE_NODE { bool global_valid; // If allocation is mapped, set to "true" to be picked up by subsequently bound ranges VkDeviceMemory mem; VkMemoryAllocateInfo alloc_info; - std::unordered_set obj_bindings; // objects bound to this memory + std::unordered_set obj_bindings; // objects bound to this memory std::unordered_set command_buffer_bindings; // cmd buffers referencing this memory std::unordered_map bound_ranges; // Map of object to its binding range // Convenience vectors image/buff handles to speed up iterating over images or buffers independently