We can't reasonably auto generate this because it's output in an otherwise input pNext chain.
Signed-off-by: Georg Lehmann dadschoorse@gmail.com --- dlls/winevulkan/make_vulkan | 8 +++ dlls/winevulkan/vulkan.c | 110 ++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+)
diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index c609bbfd151..2f3d647ef9b 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -205,6 +205,8 @@ FUNCTION_OVERRIDES = { # Device functions "vkAllocateCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.NONE}, "vkCreateCommandPool" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, + "vkCreateComputePipelines" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.PRIVATE}, + "vkCreateGraphicsPipelines" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.PRIVATE}, "vkDestroyCommandPool" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, "vkDestroyDevice" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.NONE}, "vkFreeCommandBuffers" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.NONE}, @@ -250,6 +252,9 @@ FUNCTION_OVERRIDES = { "vkGetDeviceGroupSurfacePresentModesKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC}, "vkGetPhysicalDevicePresentRectanglesKHR" : {"dispatch" : True, "driver" : True, "thunk" : ThunkType.PUBLIC},
+ # VK_KHR_ray_tracing_pipeline + "vkCreateRayTracingPipelinesKHR" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.PRIVATE}, + # VK_EXT_calibrated_timestamps "vkGetPhysicalDeviceCalibrateableTimeDomainsEXT" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.NONE}, "vkGetCalibratedTimestampsEXT" : {"dispatch" : True, "driver" : False, "thunk" : ThunkType.NONE}, @@ -261,6 +266,9 @@ FUNCTION_OVERRIDES = { # VK_EXT_debug_report "vkCreateDebugReportCallbackEXT" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, "vkDestroyDebugReportCallbackEXT" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.NONE}, + + # VK_NV_ray_tracing + "vkCreateRayTracingPipelinesNV" : {"dispatch": True, "driver" : False, "thunk" : ThunkType.PRIVATE}, }
STRUCT_CHAIN_CONVERSIONS = { diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 19cc999433b..f5d1a1f4fc2 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -1758,6 +1758,116 @@ NTSTATUS wine_vkDestroyDebugReportCallbackEXT(void *args) return STATUS_SUCCESS; }
+static void fixup_pipeline_feedback(VkPipelineCreationFeedback *feedback, uint32_t count) +{ +#if defined(USE_STRUCT_CONVERSION) + struct host_pipeline_feedback + { + VkPipelineCreationFeedbackFlags flags; + uint64_t duration; + } *host_feedback; + int64_t i; + + host_feedback = (void *) feedback; + + for (i = count - 1; i >= 0; i--) + { + memmove(&feedback[i].duration, &host_feedback[i].duration, sizeof(uint64_t)); + feedback[i].flags = host_feedback[i].flags; + } +#else + (void)feedback; + (void)count; +#endif +} + +static void fixup_pipeline_feedback_info(const void *pipeline_info) +{ + VkPipelineCreationFeedbackCreateInfo *feedback; + + feedback = wine_vk_find_struct(pipeline_info, PIPELINE_CREATION_FEEDBACK_CREATE_INFO); + + if (!feedback) + return; + + fixup_pipeline_feedback(feedback->pPipelineCreationFeedback, 1); + fixup_pipeline_feedback(feedback->pPipelineStageCreationFeedbacks, + feedback->pipelineStageCreationFeedbackCount); +} + +NTSTATUS wine_vkCreateComputePipelines(void *args) +{ + struct vkCreateComputePipelines_params *params = args; + VkResult res; + uint32_t i; + + TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + res = thunk_vkCreateComputePipelines(params->device, params->pipelineCache, + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + for (i = 0; i < params->createInfoCount; i++) + fixup_pipeline_feedback_info(¶ms->pCreateInfos[i]); + + return res; +} + +NTSTATUS wine_vkCreateGraphicsPipelines(void *args) +{ + struct vkCreateGraphicsPipelines_params *params = args; + VkResult res; + uint32_t i; + + TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + res = thunk_vkCreateGraphicsPipelines(params->device, params->pipelineCache, + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + for (i = 0; i < params->createInfoCount; i++) + fixup_pipeline_feedback_info(¶ms->pCreateInfos[i]); + + return res; +} + +NTSTATUS wine_vkCreateRayTracingPipelinesKHR(void *args) +{ + struct vkCreateRayTracingPipelinesKHR_params *params = args; + VkResult res; + uint32_t i; + + TRACE("%p, 0x%s, 0x%s, %u, %p, %p, %p\n", params->device, + wine_dbgstr_longlong(params->deferredOperation), wine_dbgstr_longlong(params->pipelineCache), + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + res = thunk_vkCreateRayTracingPipelinesKHR(params->device, params->deferredOperation, params->pipelineCache, + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + for (i = 0; i < params->createInfoCount; i++) + fixup_pipeline_feedback_info(¶ms->pCreateInfos[i]); + + return res; +} + +NTSTATUS wine_vkCreateRayTracingPipelinesNV(void *args) +{ + struct vkCreateRayTracingPipelinesNV_params *params = args; + VkResult res; + uint32_t i; + + TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + res = thunk_vkCreateRayTracingPipelinesNV(params->device, params->pipelineCache, + params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines); + + for (i = 0; i < params->createInfoCount; i++) + fixup_pipeline_feedback_info(¶ms->pCreateInfos[i]); + + return res; +} + BOOL WINAPI wine_vk_is_available_instance_function(VkInstance instance, const char *name) { return !!vk_funcs->p_vkGetInstanceProcAddr(instance->instance, name);