diff --git a/util/test/demos/vk/vk_headers.h b/util/test/demos/vk/vk_headers.h index 674de0579..6ce154ee4 100644 --- a/util/test/demos/vk/vk_headers.h +++ b/util/test/demos/vk/vk_headers.h @@ -30,6 +30,29 @@ #define VK_NO_PROTOTYPES +#if defined(__LP64__) || defined(_WIN64) || (defined(__x86_64__) && !defined(__ILP32__)) || \ + defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || \ + defined(__powerpc64__) + +#else + +// make handles typed even on 32-bit, by relying on C++ +#define VK_DEFINE_NON_DISPATCHABLE_HANDLE(obj) \ + struct obj \ + { \ + obj() : handle(0) {} \ + obj(uint64_t x) : handle(x) {} \ + bool operator==(const obj &other) const { return handle == other.handle; } \ + bool operator<(const obj &other) const { return handle < other.handle; } \ + bool operator!=(const obj &other) const { return handle != other.handle; } \ + bool operator==(const int &other) const { return handle == other; } \ + bool operator!=(const int &other) const { return handle != other; } \ + operator bool() const { return handle != 0; } \ + uint64_t handle; \ + }; + +#endif + // first include our local vulkan to ensure it's used over any system header #include "official/vulkan/vulkan.h"