Commit 6536dec3 authored by Roderick Colenbrander's avatar Roderick Colenbrander Committed by Alexandre Julliard

winevulkan: Implement vkQueueSubmit.

parent 88a96bbd
......@@ -117,6 +117,7 @@ FUNCTION_OVERRIDES = {
"vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkGetDeviceProcAddr" : {"dispatch" : True, "driver" : True, "thunk" : False},
"vkGetDeviceQueue" : {"dispatch": True, "driver" : False, "thunk" : False},
"vkQueueSubmit" : {"dispatch": True, "driver" : False, "thunk" : False},
# VK_KHR_surface
"vkDestroySurfaceKHR" : {"dispatch" : True, "driver" : True, "thunk" : False},
......
......@@ -968,6 +968,62 @@ VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supporte
return VK_SUCCESS;
}
VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t count,
const VkSubmitInfo *submits, VkFence fence)
{
VkSubmitInfo *submits_host;
VkResult res;
VkCommandBuffer *command_buffers;
unsigned int i, j, num_command_buffers;
TRACE("%p %u %p 0x%s\n", queue, count, submits, wine_dbgstr_longlong(fence));
if (count == 0)
{
return queue->device->funcs.p_vkQueueSubmit(queue->queue, 0, NULL, fence);
}
submits_host = heap_calloc(count, sizeof(*submits_host));
if (!submits_host)
{
ERR("Unable to allocate memory for submit buffers!\n");
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
for (i = 0; i < count; i++)
{
memcpy(&submits_host[i], &submits[i], sizeof(*submits_host));
num_command_buffers = submits[i].commandBufferCount;
command_buffers = heap_calloc(num_command_buffers, sizeof(*submits_host));
if (!command_buffers)
{
ERR("Unable to allocate memory for comman buffers!\n");
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto err;
}
for (j = 0; j < num_command_buffers; j++)
{
command_buffers[j] = submits[i].pCommandBuffers[j]->command_buffer;
}
submits_host[i].pCommandBuffers = command_buffers;
}
res = queue->device->funcs.p_vkQueueSubmit(queue->queue, count, submits_host, fence);
err:
for (i = 0; i < count; i++)
{
heap_free((void *)submits_host[i].pCommandBuffers);
}
heap_free(submits_host);
TRACE("Returning %d\n", res);
return res;
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
{
switch (reason)
......
......@@ -1641,12 +1641,6 @@ static VkResult WINAPI wine_vkQueueBindSparse(VkQueue queue, uint32_t bindInfoCo
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence)
{
FIXME("stub: %p, %u, %p, 0x%s\n", queue, submitCount, pSubmits, wine_dbgstr_longlong(fence));
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
static VkResult WINAPI wine_vkQueueWaitIdle(VkQueue queue)
{
FIXME("stub: %p\n", queue);
......
......@@ -37,6 +37,7 @@ VkResult WINAPI wine_vkGetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physi
VkBool32 WINAPI wine_vkGetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkGetSwapchainImagesKHR(VkDevice device, VkSwapchainKHR swapchain, uint32_t *pSwapchainImageCount, VkImage *pSwapchainImages) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *pPresentInfo) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t submitCount, const VkSubmitInfo *pSubmits, VkFence fence) DECLSPEC_HIDDEN;
typedef struct VkCommandBufferAllocateInfo_host
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment