Commit 71b034c3 authored by Georg Lehmann's avatar Georg Lehmann Committed by Alexandre Julliard

winevulkan: Manually fixup struct alignment for VkPipelineCreationFeedback.

We can't reasonably auto generate this because it's output in an otherwise input pNext chain. Signed-off-by: 's avatarGeorg Lehmann <dadschoorse@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent be8b50b8
......@@ -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 = {
......
......@@ -1758,6 +1758,113 @@ 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;
}
#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(&params->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(&params->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(&params->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(&params->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);
......
......@@ -7155,22 +7155,18 @@ static NTSTATUS wine_vkCreateBufferView(void *args)
#endif
}
static NTSTATUS wine_vkCreateComputePipelines(void *args)
VkResult thunk_vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
struct vkCreateComputePipelines_params *params = args;
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkComputePipelineCreateInfo_host *pCreateInfos_host;
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win_to_host(pCreateInfos, createInfoCount);
result = device->funcs.p_vkCreateComputePipelines(device->device, pipelineCache, createInfoCount, pCreateInfos_host, NULL, pPipelines);
pCreateInfos_host = convert_VkComputePipelineCreateInfo_array_win_to_host(params->pCreateInfos, params->createInfoCount);
result = params->device->funcs.p_vkCreateComputePipelines(params->device->device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines);
free_VkComputePipelineCreateInfo_array(pCreateInfos_host, params->createInfoCount);
free_VkComputePipelineCreateInfo_array(pCreateInfos_host, createInfoCount);
return result;
#else
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
return params->device->funcs.p_vkCreateComputePipelines(params->device->device, params->pipelineCache, params->createInfoCount, params->pCreateInfos, NULL, params->pPipelines);
return device->funcs.p_vkCreateComputePipelines(device->device, pipelineCache, createInfoCount, pCreateInfos, NULL, pPipelines);
#endif
}
......@@ -7288,22 +7284,18 @@ static NTSTATUS wine_vkCreateFramebuffer(void *args)
#endif
}
static NTSTATUS wine_vkCreateGraphicsPipelines(void *args)
VkResult thunk_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
struct vkCreateGraphicsPipelines_params *params = args;
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkGraphicsPipelineCreateInfo_host *pCreateInfos_host;
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win_to_host(params->pCreateInfos, params->createInfoCount);
result = params->device->funcs.p_vkCreateGraphicsPipelines(params->device->device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines);
pCreateInfos_host = convert_VkGraphicsPipelineCreateInfo_array_win_to_host(pCreateInfos, createInfoCount);
result = device->funcs.p_vkCreateGraphicsPipelines(device->device, pipelineCache, createInfoCount, pCreateInfos_host, NULL, pPipelines);
free_VkGraphicsPipelineCreateInfo_array(pCreateInfos_host, params->createInfoCount);
free_VkGraphicsPipelineCreateInfo_array(pCreateInfos_host, createInfoCount);
return result;
#else
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
return params->device->funcs.p_vkCreateGraphicsPipelines(params->device->device, params->pipelineCache, params->createInfoCount, params->pCreateInfos, NULL, params->pPipelines);
return device->funcs.p_vkCreateGraphicsPipelines(device->device, pipelineCache, createInfoCount, pCreateInfos, NULL, pPipelines);
#endif
}
......@@ -7386,41 +7378,33 @@ static NTSTATUS wine_vkCreateQueryPool(void *args)
return params->device->funcs.p_vkCreateQueryPool(params->device->device, params->pCreateInfo, NULL, params->pQueryPool);
}
static NTSTATUS wine_vkCreateRayTracingPipelinesKHR(void *args)
VkResult thunk_vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
struct vkCreateRayTracingPipelinesKHR_params *params = args;
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkRayTracingPipelineCreateInfoKHR_host *pCreateInfos_host;
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);
pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win_to_host(pCreateInfos, createInfoCount);
result = device->funcs.p_vkCreateRayTracingPipelinesKHR(device->device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos_host, NULL, pPipelines);
pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoKHR_array_win_to_host(params->pCreateInfos, params->createInfoCount);
result = params->device->funcs.p_vkCreateRayTracingPipelinesKHR(params->device->device, params->deferredOperation, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines);
free_VkRayTracingPipelineCreateInfoKHR_array(pCreateInfos_host, params->createInfoCount);
free_VkRayTracingPipelineCreateInfoKHR_array(pCreateInfos_host, createInfoCount);
return result;
#else
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);
return params->device->funcs.p_vkCreateRayTracingPipelinesKHR(params->device->device, params->deferredOperation, params->pipelineCache, params->createInfoCount, params->pCreateInfos, NULL, params->pPipelines);
return device->funcs.p_vkCreateRayTracingPipelinesKHR(device->device, deferredOperation, pipelineCache, createInfoCount, pCreateInfos, NULL, pPipelines);
#endif
}
static NTSTATUS wine_vkCreateRayTracingPipelinesNV(void *args)
VkResult thunk_vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines)
{
struct vkCreateRayTracingPipelinesNV_params *params = args;
#if defined(USE_STRUCT_CONVERSION)
VkResult result;
VkRayTracingPipelineCreateInfoNV_host *pCreateInfos_host;
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win_to_host(params->pCreateInfos, params->createInfoCount);
result = params->device->funcs.p_vkCreateRayTracingPipelinesNV(params->device->device, params->pipelineCache, params->createInfoCount, pCreateInfos_host, NULL, params->pPipelines);
pCreateInfos_host = convert_VkRayTracingPipelineCreateInfoNV_array_win_to_host(pCreateInfos, createInfoCount);
result = device->funcs.p_vkCreateRayTracingPipelinesNV(device->device, pipelineCache, createInfoCount, pCreateInfos_host, NULL, pPipelines);
free_VkRayTracingPipelineCreateInfoNV_array(pCreateInfos_host, params->createInfoCount);
free_VkRayTracingPipelineCreateInfoNV_array(pCreateInfos_host, createInfoCount);
return result;
#else
TRACE("%p, 0x%s, %u, %p, %p, %p\n", params->device, wine_dbgstr_longlong(params->pipelineCache), params->createInfoCount, params->pCreateInfos, params->pAllocator, params->pPipelines);
return params->device->funcs.p_vkCreateRayTracingPipelinesNV(params->device->device, params->pipelineCache, params->createInfoCount, params->pCreateInfos, NULL, params->pPipelines);
return device->funcs.p_vkCreateRayTracingPipelinesNV(device->device, pipelineCache, createInfoCount, pCreateInfos, NULL, pPipelines);
#endif
}
......
......@@ -17,10 +17,14 @@
/* Functions for which we have custom implementations outside of the thunks. */
NTSTATUS wine_vkAllocateCommandBuffers(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateCommandPool(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateComputePipelines(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateDebugReportCallbackEXT(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateDebugUtilsMessengerEXT(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateDevice(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateGraphicsPipelines(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateInstance(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateRayTracingPipelinesKHR(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateRayTracingPipelinesNV(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkCreateWin32SurfaceKHR(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkDestroyCommandPool(void *args) DECLSPEC_HIDDEN;
NTSTATUS wine_vkDestroyDebugReportCallbackEXT(void *args) DECLSPEC_HIDDEN;
......@@ -55,6 +59,10 @@ NTSTATUS wine_vkGetPhysicalDeviceSurfaceCapabilities2KHR(void *args) DECLSPEC_HI
NTSTATUS wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(void *args) DECLSPEC_HIDDEN;
/* Private thunks */
VkResult thunk_vkCreateComputePipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkComputePipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) DECLSPEC_HIDDEN;
VkResult thunk_vkCreateGraphicsPipelines(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkGraphicsPipelineCreateInfo *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) DECLSPEC_HIDDEN;
VkResult thunk_vkCreateRayTracingPipelinesKHR(VkDevice device, VkDeferredOperationKHR deferredOperation, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoKHR *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) DECLSPEC_HIDDEN;
VkResult thunk_vkCreateRayTracingPipelinesNV(VkDevice device, VkPipelineCache pipelineCache, uint32_t createInfoCount, const VkRayTracingPipelineCreateInfoNV *pCreateInfos, const VkAllocationCallbacks *pAllocator, VkPipeline *pPipelines) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceImageFormatProperties2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceImageFormatInfo2 *pImageFormatInfo, VkImageFormatProperties2 *pImageFormatProperties) DECLSPEC_HIDDEN;
VkResult thunk_vkGetPhysicalDeviceSurfaceCapabilities2KHR(VkPhysicalDevice physicalDevice, const VkPhysicalDeviceSurfaceInfo2KHR *pSurfaceInfo, VkSurfaceCapabilities2KHR *pSurfaceCapabilities) DECLSPEC_HIDDEN;
......
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