Commit 2c548247 authored by Victor Hermann Chiletto's avatar Victor Hermann Chiletto Committed by Alexandre Julliard

winevulkan: Implement vkEnumerateDeviceLayerProperties.

Currently, this function is passed through winevulkan to the system's Vulkan loader, which causes the loader to write the system's device layers properties in pProperties. Unreal Engine 4 then calls vkEnumerateDeviceExtensionProperties, using VkLayerProperties::layerName as the pLayerName. winevulkan's implementation of vkEnumerateDeviceExtensionProperties then returns VK_ERROR_LAYER_NOT_PRESENT, crashing UE4. This issue was found while debugging Project Wingman (Steam appid 895870), but it should also happen to any UE4 application using the Vulkan RHI. Signed-off-by: 's avatarVictor Hermann Chiletto <v@hnn.net.br> Signed-off-by: 's avatarJoshua Ashton <joshua@froggi.es> Signed-off-by: 's avatarLiam Middlebrook <lmiddlebrook@nvidia.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 3fd9a423
......@@ -153,6 +153,7 @@ FUNCTION_OVERRIDES = {
"vkCreateDevice" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkDestroyInstance" : {"dispatch" : False, "driver" : True, "thunk" : False },
"vkEnumerateDeviceExtensionProperties" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkEnumerateDeviceLayerProperties": {"dispatch": True, "driver": False, "thunk": False},
"vkEnumeratePhysicalDeviceGroups" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkEnumeratePhysicalDevices" : {"dispatch" : True, "driver" : False, "thunk" : False},
"vkGetPhysicalDeviceExternalBufferProperties" : {"dispatch" : False, "driver" : False, "thunk" : False},
......
......@@ -1061,6 +1061,14 @@ VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_na
return *count < num_properties ? VK_INCOMPLETE : VK_SUCCESS;
}
VkResult WINAPI wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice phys_dev, uint32_t *count, VkLayerProperties *properties)
{
TRACE("%p, %p, %p\n", phys_dev, count, properties);
*count = 0;
return VK_SUCCESS;
}
VkResult WINAPI wine_vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayerProperties *properties)
{
TRACE("%p, %p\n", count, properties);
......
......@@ -5710,12 +5710,6 @@ VkResult WINAPI wine_vkEndCommandBuffer(VkCommandBuffer commandBuffer)
return commandBuffer->device->funcs.p_vkEndCommandBuffer(commandBuffer->command_buffer);
}
VkResult WINAPI wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties)
{
TRACE("%p, %p, %p\n", physicalDevice, pPropertyCount, pProperties);
return physicalDevice->instance->funcs.p_vkEnumerateDeviceLayerProperties(physicalDevice->phys_dev, pPropertyCount, pProperties);
}
static VkResult WINAPI wine_vkEnumeratePhysicalDeviceQueueFamilyPerformanceQueryCountersKHR(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, uint32_t *pCounterCount, VkPerformanceCounterKHR *pCounters, VkPerformanceCounterDescriptionKHR *pCounterDescriptions)
{
TRACE("%p, %u, %p, %p, %p\n", physicalDevice, queueFamilyIndex, pCounterCount, pCounters, pCounterDescriptions);
......
......@@ -33,6 +33,7 @@ void WINAPI wine_vkDestroyDevice(VkDevice device, const VkAllocationCallbacks *p
void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *pAllocator);
void WINAPI wine_vkDestroySurfaceKHR(VkInstance instance, VkSurfaceKHR surface, const VkAllocationCallbacks *pAllocator);
VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice physicalDevice, const char *pLayerName, uint32_t *pPropertyCount, VkExtensionProperties *pProperties);
VkResult WINAPI wine_vkEnumerateDeviceLayerProperties(VkPhysicalDevice physicalDevice, uint32_t *pPropertyCount, VkLayerProperties *pProperties);
VkResult WINAPI wine_vkEnumeratePhysicalDeviceGroups(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties);
VkResult WINAPI wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, uint32_t *pPhysicalDeviceGroupCount, VkPhysicalDeviceGroupProperties *pPhysicalDeviceGroupProperties) DECLSPEC_HIDDEN;
VkResult WINAPI wine_vkEnumeratePhysicalDevices(VkInstance instance, uint32_t *pPhysicalDeviceCount, VkPhysicalDevice *pPhysicalDevices);
......
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