[PATCH 1/7] winevulkan: Implement vkQueueSubmit.
Roderick Colenbrander
thunderbird2k at gmail.com
Thu Mar 15 01:39:34 CDT 2018
Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
---
dlls/winevulkan/make_vulkan | 1 +
dlls/winevulkan/vulkan.c | 56 +++++++++++++++++++++++++++++++++++++++++
dlls/winevulkan/vulkan_thunks.c | 6 -----
dlls/winevulkan/vulkan_thunks.h | 1 +
4 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
index 5c5f38f40f..af2b369f05 100755
--- a/dlls/winevulkan/make_vulkan
+++ b/dlls/winevulkan/make_vulkan
@@ -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},
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index 0a5a77dcf3..08a957bc22 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -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)
diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c
index f1be25ed75..285c7cb652 100644
--- a/dlls/winevulkan/vulkan_thunks.c
+++ b/dlls/winevulkan/vulkan_thunks.c
@@ -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);
diff --git a/dlls/winevulkan/vulkan_thunks.h b/dlls/winevulkan/vulkan_thunks.h
index 951945d548..ae95e938ed 100644
--- a/dlls/winevulkan/vulkan_thunks.h
+++ b/dlls/winevulkan/vulkan_thunks.h
@@ -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
{
--
2.14.3
More information about the wine-devel
mailing list