Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 619157c6 authored by Jesse Hall's avatar Jesse Hall
Browse files

vulkan: Use the same dispatch magic value as LunarG

Change-Id: I3ac0d3953bd395ffb459aa7b8c7c08914b49008b
(cherry picked from commit 6a4503c5b8d01cc89e1ebde747c162ee326ebbff)
parent eb97086a
Loading
Loading
Loading
Loading
+7 −8
Original line number Original line Diff line number Diff line
@@ -38,15 +38,14 @@ typedef struct hwvulkan_module_t {
 * implementation-defined data). On return from the creation function, the
 * implementation-defined data). On return from the creation function, the
 * 'magic' field must contain HWVULKAN_DISPATCH_MAGIC; the loader will overwrite
 * 'magic' field must contain HWVULKAN_DISPATCH_MAGIC; the loader will overwrite
 * the 'vtbl' field.
 * the 'vtbl' field.
 *
 * NOTE: The magic value and the layout of hwvulkan_dispatch_t match the LunarG
 * loader used on platforms, to avoid pointless annoying differences for
 * multi-platform drivers. Don't change them without a good reason. If there is
 * an opportunity to change it, using a magic value that doesn't leave the
 * upper 32-bits zero on 64-bit platforms would be nice.
 */
 */
#if defined(__LP64__)
#define HWVULKAN_DISPATCH_MAGIC 0x01CDC0DE
#define HWVULKAN_DISPATCH_MAGIC UINT64_C(0xCA11AB1E00C0DE00)
#elif defined(__ILP32__)
#define HWVULKAN_DISPATCH_MAGIC UINT32_C(0xCA11AB1E)
#else
#error "unknown pointer size?!"
#endif

typedef union {
typedef union {
    uintptr_t magic;
    uintptr_t magic;
    const void* vtbl;
    const void* vtbl;