From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winevulkan/make_vulkan | 3 + dlls/winevulkan/vulkan_thunks.c | 208 +++++++++++++++++++++++++++++++- 2 files changed, 206 insertions(+), 5 deletions(-)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index f8135372a0e..1be06e563ea 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -308,6 +308,9 @@ STRUCT_CHAIN_CONVERSIONS = { "VkImageCreateInfo": {}, "VkPhysicalDeviceExternalBufferInfo": {}, "VkPhysicalDeviceImageFormatInfo2": {}, + "VkCommandBufferSubmitInfo": {}, + "VkSubmitInfo": {}, + "VkSubmitInfo2": {},
# Ignore to not confuse host loader. "VkDeviceCreateInfo": {"strip": ["VK_STRUCTURE_TYPE_LOADER_DEVICE_CREATE_INFO"]}, diff --git a/dlls/winevulkan/vulkan_thunks.c b/dlls/winevulkan/vulkan_thunks.c index c1d20f48098..70ecd1f38ec 100644 --- a/dlls/winevulkan/vulkan_thunks.c +++ b/dlls/winevulkan/vulkan_thunks.c @@ -39519,10 +39519,13 @@ static void convert_VkPresentInfoKHR_win32_to_unwrapped_host(struct conversion_c #ifdef _WIN64 static void convert_VkSubmitInfo_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo *in, VkSubmitInfo *out) { + const VkBaseInStructure *in_header; + VkBaseOutStructure *out_header = (void *)out; + if (!in) return;
out->sType = in->sType; - out->pNext = in->pNext; + out->pNext = NULL; out->waitSemaphoreCount = in->waitSemaphoreCount; out->pWaitSemaphores = in->pWaitSemaphores; out->pWaitDstStageMask = in->pWaitDstStageMask; @@ -39530,6 +39533,110 @@ static void convert_VkSubmitInfo_win64_to_host(struct conversion_context *ctx, c out->pCommandBuffers = convert_VkCommandBuffer_array_win64_to_host(ctx, in->pCommandBuffers, in->commandBufferCount); out->signalSemaphoreCount = in->signalSemaphoreCount; out->pSignalSemaphores = in->pSignalSemaphores; + + for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) + { + switch (in_header->sType) + { + case VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO: + { + VkDeviceGroupSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkDeviceGroupSubmitInfo *in_ext = (const VkDeviceGroupSubmitInfo *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_DEVICE_GROUP_SUBMIT_INFO; + out_ext->pNext = NULL; + out_ext->waitSemaphoreCount = in_ext->waitSemaphoreCount; + out_ext->pWaitSemaphoreDeviceIndices = in_ext->pWaitSemaphoreDeviceIndices; + out_ext->commandBufferCount = in_ext->commandBufferCount; + out_ext->pCommandBufferDeviceMasks = in_ext->pCommandBufferDeviceMasks; + out_ext->signalSemaphoreCount = in_ext->signalSemaphoreCount; + out_ext->pSignalSemaphoreDeviceIndices = in_ext->pSignalSemaphoreDeviceIndices; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: + { + VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkFrameBoundaryEXT *in_ext = (const VkFrameBoundaryEXT *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; + out_ext->pNext = NULL; + out_ext->flags = in_ext->flags; + out_ext->frameID = in_ext->frameID; + out_ext->imageCount = in_ext->imageCount; + out_ext->pImages = in_ext->pImages; + out_ext->bufferCount = in_ext->bufferCount; + out_ext->pBuffers = in_ext->pBuffers; + out_ext->tagName = in_ext->tagName; + out_ext->tagSize = in_ext->tagSize; + out_ext->pTag = in_ext->pTag; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM: + { + VkFrameBoundaryTensorsARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkFrameBoundaryTensorsARM *in_ext = (const VkFrameBoundaryTensorsARM *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM; + out_ext->pNext = NULL; + out_ext->tensorCount = in_ext->tensorCount; + out_ext->pTensors = in_ext->pTensors; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: + { + VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkLatencySubmissionPresentIdNV *in_ext = (const VkLatencySubmissionPresentIdNV *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; + out_ext->pNext = NULL; + out_ext->presentID = in_ext->presentID; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: + { + VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPerformanceQuerySubmitInfoKHR *in_ext = (const VkPerformanceQuerySubmitInfoKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; + out_ext->pNext = NULL; + out_ext->counterPassIndex = in_ext->counterPassIndex; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO: + { + VkProtectedSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkProtectedSubmitInfo *in_ext = (const VkProtectedSubmitInfo *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PROTECTED_SUBMIT_INFO; + out_ext->pNext = NULL; + out_ext->protectedSubmit = in_ext->protectedSubmit; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO: + { + VkTimelineSemaphoreSubmitInfo *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkTimelineSemaphoreSubmitInfo *in_ext = (const VkTimelineSemaphoreSubmitInfo *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO; + out_ext->pNext = NULL; + out_ext->waitSemaphoreValueCount = in_ext->waitSemaphoreValueCount; + out_ext->pWaitSemaphoreValues = in_ext->pWaitSemaphoreValues; + out_ext->signalSemaphoreValueCount = in_ext->signalSemaphoreValueCount; + out_ext->pSignalSemaphoreValues = in_ext->pSignalSemaphoreValues; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + default: + FIXME("Unhandled sType %u.\n", in_header->sType); + break; + } + } } #endif /* _WIN64 */
@@ -39690,14 +39797,39 @@ static const VkSubmitInfo *convert_VkSubmitInfo_array_win32_to_host(struct conve }
#ifdef _WIN64 -static void convert_VkCommandBufferSubmitInfo_win64_to_host(const VkCommandBufferSubmitInfo *in, VkCommandBufferSubmitInfo *out) +static void convert_VkCommandBufferSubmitInfo_win64_to_host(struct conversion_context *ctx, const VkCommandBufferSubmitInfo *in, VkCommandBufferSubmitInfo *out) { + const VkBaseInStructure *in_header; + VkBaseOutStructure *out_header = (void *)out; + if (!in) return;
out->sType = in->sType; - out->pNext = in->pNext; + out->pNext = NULL; out->commandBuffer = wine_cmd_buffer_from_handle(in->commandBuffer)->host.command_buffer; out->deviceMask = in->deviceMask; + + for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) + { + switch (in_header->sType) + { + case VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM: + { + VkRenderPassStripeSubmitInfoARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkRenderPassStripeSubmitInfoARM *in_ext = (const VkRenderPassStripeSubmitInfoARM *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_RENDER_PASS_STRIPE_SUBMIT_INFO_ARM; + out_ext->pNext = NULL; + out_ext->stripeSemaphoreInfoCount = in_ext->stripeSemaphoreInfoCount; + out_ext->pStripeSemaphoreInfos = in_ext->pStripeSemaphoreInfos; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + default: + FIXME("Unhandled sType %u.\n", in_header->sType); + break; + } + } } #endif /* _WIN64 */
@@ -39712,7 +39844,7 @@ static const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_ out = conversion_context_alloc(ctx, count * sizeof(*out)); for (i = 0; i < count; i++) { - convert_VkCommandBufferSubmitInfo_win64_to_host(&in[i], &out[i]); + convert_VkCommandBufferSubmitInfo_win64_to_host(ctx, &in[i], &out[i]); }
return out; @@ -39722,10 +39854,13 @@ static const VkCommandBufferSubmitInfo *convert_VkCommandBufferSubmitInfo_array_ #ifdef _WIN64 static void convert_VkSubmitInfo2_win64_to_host(struct conversion_context *ctx, const VkSubmitInfo2 *in, VkSubmitInfo2 *out) { + const VkBaseInStructure *in_header; + VkBaseOutStructure *out_header = (void *)out; + if (!in) return;
out->sType = in->sType; - out->pNext = in->pNext; + out->pNext = NULL; out->flags = in->flags; out->waitSemaphoreInfoCount = in->waitSemaphoreInfoCount; out->pWaitSemaphoreInfos = in->pWaitSemaphoreInfos; @@ -39733,6 +39868,69 @@ static void convert_VkSubmitInfo2_win64_to_host(struct conversion_context *ctx, out->pCommandBufferInfos = convert_VkCommandBufferSubmitInfo_array_win64_to_host(ctx, in->pCommandBufferInfos, in->commandBufferInfoCount); out->signalSemaphoreInfoCount = in->signalSemaphoreInfoCount; out->pSignalSemaphoreInfos = in->pSignalSemaphoreInfos; + + for (in_header = (void *)in->pNext; in_header; in_header = (void *)in_header->pNext) + { + switch (in_header->sType) + { + case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT: + { + VkFrameBoundaryEXT *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkFrameBoundaryEXT *in_ext = (const VkFrameBoundaryEXT *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_EXT; + out_ext->pNext = NULL; + out_ext->flags = in_ext->flags; + out_ext->frameID = in_ext->frameID; + out_ext->imageCount = in_ext->imageCount; + out_ext->pImages = in_ext->pImages; + out_ext->bufferCount = in_ext->bufferCount; + out_ext->pBuffers = in_ext->pBuffers; + out_ext->tagName = in_ext->tagName; + out_ext->tagSize = in_ext->tagSize; + out_ext->pTag = in_ext->pTag; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM: + { + VkFrameBoundaryTensorsARM *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkFrameBoundaryTensorsARM *in_ext = (const VkFrameBoundaryTensorsARM *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_FRAME_BOUNDARY_TENSORS_ARM; + out_ext->pNext = NULL; + out_ext->tensorCount = in_ext->tensorCount; + out_ext->pTensors = in_ext->pTensors; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV: + { + VkLatencySubmissionPresentIdNV *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkLatencySubmissionPresentIdNV *in_ext = (const VkLatencySubmissionPresentIdNV *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV; + out_ext->pNext = NULL; + out_ext->presentID = in_ext->presentID; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + case VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR: + { + VkPerformanceQuerySubmitInfoKHR *out_ext = conversion_context_alloc(ctx, sizeof(*out_ext)); + const VkPerformanceQuerySubmitInfoKHR *in_ext = (const VkPerformanceQuerySubmitInfoKHR *)in_header; + out_ext->sType = VK_STRUCTURE_TYPE_PERFORMANCE_QUERY_SUBMIT_INFO_KHR; + out_ext->pNext = NULL; + out_ext->counterPassIndex = in_ext->counterPassIndex; + out_header->pNext = (void *)out_ext; + out_header = (void *)out_ext; + break; + } + default: + FIXME("Unhandled sType %u.\n", in_header->sType); + break; + } + } } #endif /* _WIN64 */