From 95a64071fbf3acb56223dbc1400fb3e3875ef269 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 9 Dec 2015 23:15:16 +0100 Subject: [PATCH] Fixes for new handle types (opaque pointers). Note, 32-bit is broken. --- renderdoc/driver/vulkan/vk_resources.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_resources.h b/renderdoc/driver/vulkan/vk_resources.h index 479c8c071..2d215c4fb 100644 --- a/renderdoc/driver/vulkan/vk_resources.h +++ b/renderdoc/driver/vulkan/vk_resources.h @@ -120,7 +120,7 @@ struct TypedRealHandle struct WrappedVkNonDispRes : public WrappedVkRes { - template WrappedVkNonDispRes(T obj, ResourceId objId) : real(obj.handle), id(objId), record(NULL) {} + template WrappedVkNonDispRes(T obj, ResourceId objId) : real(obj), id(objId), record(NULL) {} RealVkRes real; ResourceId id; @@ -384,10 +384,14 @@ template struct UnwrapHelper {}; typedef WrappedVkNonDispRes ParentType; \ typedef CONCAT(Wrapped, vulkantype) Outer; \ static TypedRealHandle ToTypedHandle(vulkantype real) \ - { TypedRealHandle h; h.type = (VkResourceType)Outer::TypeEnum; h.real = RealVkRes(real.handle); return h; } \ - static Outer *FromHandle(vulkantype wrapped) { return (Outer *) (uintptr_t)wrapped.handle; } \ + { TypedRealHandle h; h.type = (VkResourceType)Outer::TypeEnum; h.real = RealVkRes(real); return h; } \ + static Outer *FromHandle(vulkantype wrapped) { return (Outer *) (uintptr_t)wrapped; } \ }; +// VKTODOHIGH this no longer works on 32-bit since handles are no longer strongly typed. +// solution will *probably* be to modify vulkan.h to use a C++ class with appropriate overrides, +// constructors and operators to still be a 64-bit element but be strongly typed. + UNWRAP_HELPER(VkInstance) UNWRAP_HELPER(VkPhysicalDevice) UNWRAP_HELPER(VkDevice) @@ -538,11 +542,6 @@ struct ImageRegionState VkImageLayout newLayout; }; -inline bool operator <(const VkDescriptorSet a, const VkDescriptorSet b) -{ - return a.handle < b.handle; -} - struct SwapchainInfo { VkFormat format;