From 184c3c0a7887ee6b1bb8bf2824afcae9e81f9d96 Mon Sep 17 00:00:00 2001 From: David Pinedo Date: Fri, 6 Nov 2015 12:54:48 -0700 Subject: [PATCH] Moved header files from include to include/vulkan --- include/vulkan/vk_icd.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 include/vulkan/vk_icd.h diff --git a/include/vulkan/vk_icd.h b/include/vulkan/vk_icd.h new file mode 100644 index 0000000..634d653 --- /dev/null +++ b/include/vulkan/vk_icd.h @@ -0,0 +1,33 @@ +#ifndef VKICD_H +#define VKICD_H + +#include +#include +#include "vk_platform.h" +#include "vk_sdk_platform.h" + +/* + * The ICD must reserve space for a pointer for the loader's dispatch + * table, at the start of . + * The ICD must initialize this variable using the SET_LOADER_MAGIC_VALUE macro. + */ + +#define ICD_LOADER_MAGIC 0x01CDC0DE + +typedef union _VK_LOADER_DATA { + uintptr_t loaderMagic; + void *loaderData; +} VK_LOADER_DATA; + +static inline void set_loader_magic_value(void* pNewObject) { + VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *) pNewObject; + loader_info->loaderMagic = ICD_LOADER_MAGIC; +} + +static inline bool valid_loader_magic_value(void* pNewObject) { + const VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *) pNewObject; + return (loader_info->loaderMagic & 0xffffffff) == ICD_LOADER_MAGIC; +} + +#endif // VKICD_H + -- 2.7.4