| Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 1 | #ifndef VKICD_H | 
 | 2 | #define VKICD_H | 
 | 3 |  | 
 | 4 | #include <stdint.h> | 
 | 5 | #include <stdbool.h> | 
| Courtney Goeltzenleuchter | b0cedb8 | 2015-04-09 11:52:55 -0600 | [diff] [blame] | 6 | #include "vk_platform.h" | 
| Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 7 |  | 
 | 8 | /* | 
 | 9 |  * The ICD must reserve space for a pointer for the loader's dispatch | 
 | 10 |  * table, at the start of <each object>. | 
 | 11 |  * The ICD must initialize this variable using the SET_LOADER_MAGIC_VALUE macro. | 
 | 12 |  */ | 
 | 13 |  | 
 | 14 | #define ICD_LOADER_MAGIC   0x01CDC0DE | 
 | 15 |  | 
 | 16 | typedef union _VK_LOADER_DATA { | 
 | 17 |   uint32_t loaderMagic; | 
 | 18 |   void *loaderData; | 
 | 19 | } VK_LOADER_DATA; | 
 | 20 |  | 
| Tony Barbour | fc15ff8 | 2015-04-20 16:28:46 -0600 | [diff] [blame] | 21 | static inline void set_loader_magic_value(VkObject pNewObject) { | 
| Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 22 |     VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *) pNewObject; | 
 | 23 |     loader_info->loaderMagic = ICD_LOADER_MAGIC; | 
 | 24 | } | 
 | 25 |  | 
| Tony Barbour | fc15ff8 | 2015-04-20 16:28:46 -0600 | [diff] [blame] | 26 | static inline bool valid_loader_magic_value(VkObject pNewObject) { | 
| Courtney Goeltzenleuchter | 64d1a71 | 2015-04-08 18:04:29 -0600 | [diff] [blame] | 27 |     const VK_LOADER_DATA *loader_info = (VK_LOADER_DATA *) pNewObject; | 
 | 28 |     return loader_info->loaderMagic == ICD_LOADER_MAGIC; | 
 | 29 | } | 
 | 30 |  | 
 | 31 | #endif // VKICD_H | 
 | 32 |  |