if (cmd_buffer == NULL)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ cmd_buffer->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
cmd_buffer->device = device;
result = anv_cmd_buffer_init_batch_bo_chain(cmd_buffer);
if (fd < 0)
return vk_errorf(VK_ERROR_UNAVAILABLE, "failed to open %s: %m", path);
+ device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
device->instance = instance;
device->path = path;
if (!instance)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ instance->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
instance->pAllocUserData = alloc_callbacks->pUserData;
instance->pfnAlloc = alloc_callbacks->pfnAlloc;
instance->pfnFree = alloc_callbacks->pfnFree;
static VkResult
anv_queue_init(struct anv_device *device, struct anv_queue *queue)
{
+ queue->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
queue->device = device;
queue->pool = &device->surface_state_pool;
if (!device)
return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
+ device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
device->instance = physical_device->instance;
/* XXX(chadv): Can we dup() physicalDevice->fd here? */
extern "C" {
#endif
+#define ICD_LOADER_MAGIC 0x01CDC0DE
+
+typedef union _VK_LOADER_DATA {
+ uintptr_t loaderMagic;
+ void *loaderData;
+} VK_LOADER_DATA;
+
#define anv_noreturn __attribute__((__noreturn__))
#define anv_printflike(a, b) __attribute__((__format__(__printf__, a, b)))
struct anv_physical_device {
+ VK_LOADER_DATA _loader_data;
+
struct anv_instance * instance;
uint32_t chipset_id;
const char * path;
};
struct anv_instance {
+ VK_LOADER_DATA _loader_data;
+
void * pAllocUserData;
PFN_vkAllocFunction pfnAlloc;
PFN_vkFreeFunction pfnFree;
};
struct anv_queue {
+ VK_LOADER_DATA _loader_data;
+
struct anv_device * device;
struct anv_state_pool * pool;
};
struct anv_device {
+ VK_LOADER_DATA _loader_data;
+
struct anv_instance * instance;
uint32_t chipset_id;
struct brw_device_info info;
};
struct anv_cmd_buffer {
+ VK_LOADER_DATA _loader_data;
+
struct anv_device * device;
struct list_head pool_link;