aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Forbes <chrisforbes@google.com>2016-10-05 11:33:23 +1300
committerChris Forbes <chrisforbes@google.com>2016-10-06 08:37:21 +1300
commitfb9bf1809168d55d88f5f3a0dda6659c73b83ab5 (patch)
tree7f5497f55fc5732e5780519cd719dacb5b349d2e
parentdd5dc446e63f555e83309021ad010cafe836111a (diff)
downloadusermoji-fb9bf1809168d55d88f5f3a0dda6659c73b83ab5.tar.xz
layers: Unify two generic object structs
Signed-off-by: Chris Forbes <chrisforbes@google.com>
-rw-r--r--layers/core_validation_types.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h
index 8fef5c54..69012afb 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<MT_OBJ_HANDLE_TYPE> {
- size_t operator()(MT_OBJ_HANDLE_TYPE obj) const NOEXCEPT { return hash<uint64_t>()(obj.handle) ^ hash<uint32_t>()(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<MT_OBJ_HANDLE_TYPE> obj_bindings; // objects bound to this memory
+ std::unordered_set<VK_OBJECT> obj_bindings; // objects bound to this memory
std::unordered_set<VkCommandBuffer> command_buffer_bindings; // cmd buffers referencing this memory
std::unordered_map<uint64_t, MEMORY_RANGE> bound_ranges; // Map of object to its binding range
// Convenience vectors image/buff handles to speed up iterating over images or buffers independently