VKAPI_ATTR void VKAPI_CALL vkDestroyDevice( VkDevice device, const VkAllocationCallbacks* pAllocator) { struct intel_dev *dev = intel_dev(device); intel_dev_destroy(dev); }
VKAPI_ATTR void VKAPI_CALL vkGetDeviceQueue( VkDevice device, uint32_t queueFamilyIndex, uint32_t queueIndex, VkQueue* pQueue) { struct intel_dev *dev = intel_dev(device); *pQueue = (VkQueue) dev->queues[queueFamilyIndex]; }
VKAPI_ATTR VkResult VKAPI_CALL vkAllocateMemory( VkDevice device, const VkMemoryAllocateInfo* pAllocateInfo, const VkAllocationCallbacks* pAllocator, VkDeviceMemory* pMemory) { struct intel_dev *dev = intel_dev(device); return intel_mem_alloc(dev, pAllocateInfo, (struct intel_mem **) pMemory); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateBuffer( VkDevice device, const VkBufferCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBuffer* pBuffer) { struct intel_dev *dev = intel_dev(device); return intel_buf_create(dev, pCreateInfo, (struct intel_buf **) pBuffer); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateCommandPool( VkDevice device, const VkCommandPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkCommandPool* pCommandPool) { struct intel_dev *dev = intel_dev(device); return intel_cmd_pool_create(dev, pCreateInfo, (struct intel_cmd_pool **) pCommandPool); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImage( VkDevice device, const VkImageCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImage* pImage) { struct intel_dev *dev = intel_dev(device); return intel_img_create(dev, pCreateInfo, pAllocator, false, (struct intel_img **) pImage); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateEvent( VkDevice device, const VkEventCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkEvent* pEvent) { struct intel_dev *dev = intel_dev(device); return intel_event_create(dev, pCreateInfo, (struct intel_event **) pEvent); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateImageView( VkDevice device, const VkImageViewCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkImageView* pView) { struct intel_dev *dev = intel_dev(device); return intel_img_view_create(dev, pCreateInfo, (struct intel_img_view **) pView); }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateQueryPool( VkDevice device, const VkQueryPoolCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkQueryPool* pQueryPool) { struct intel_dev *dev = intel_dev(device); return intel_query_create(dev, pCreateInfo, (struct intel_query **) pQueryPool); }
VKAPI_ATTR VkResult VKAPI_CALL vkDeviceWaitIdle( VkDevice device) { struct intel_dev *dev = intel_dev(device); VkResult ret = VK_SUCCESS; uint32_t i; for (i = 0; i < ARRAY_SIZE(dev->queues); i++) { if (dev->queues[i]) { const VkResult r = intel_queue_wait(dev->queues[i], -1); if (r != VK_SUCCESS) ret = r; } } return ret; }
VKAPI_ATTR VkResult VKAPI_CALL vkCreateSemaphore( VkDevice device, const VkSemaphoreCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, VkSemaphore *pSemaphore) { /* * We want to find an unused semaphore register and initialize it. Signal * will increment the register. Wait will atomically decrement it and * block if the value is zero, or a large constant N if we do not want to * go negative. * * XXX However, MI_SEMAPHORE_MBOX does not seem to have the flexibility. */ // TODO: fully support semaphores (mean time, simulate it): struct intel_dev *dev = intel_dev(device); return intel_semaphore_create(dev, pCreateInfo, (struct intel_semaphore **) pSemaphore); }
VKAPI_ATTR VkResult VKAPI_CALL vkAllocateCommandBuffers( VkDevice device, const VkCommandBufferAllocateInfo* pAllocateInfo, VkCommandBuffer* pCommandBuffers) { struct intel_dev *dev = intel_dev(device); struct intel_cmd_pool *pool = intel_cmd_pool(pAllocateInfo->commandPool); uint32_t num_allocated = 0; VkResult res; for (uint32_t i = 0; i < pAllocateInfo->commandBufferCount; i++) { res = intel_cmd_create(dev, pAllocateInfo, (struct intel_cmd **) &pCommandBuffers[i]); if (res != VK_SUCCESS) { intel_free_cmd_buffers(pool, num_allocated, pCommandBuffers); return res; } num_allocated++; } return VK_SUCCESS; }