[PATCH 1/2] winevulkan: Adequate vkEnumerateInstanceLayerProperties to the Vulkan spec

Victor Hermann Chiletto v at hnn.net.br
Sat Mar 6 14:46:29 CST 2021


The section for vkEnumerateInstanceLayerProperties states [1]:

On success, this command returns
 * VK_SUCCESS
 * VK_INCOMPLETE

On failure, this command returns
 * VK_ERROR_OUT_OF_HOST_MEMORY
 * VK_ERROR_OUT_OF_DEVICE_MEMORY

Always setting the layer count to zero and returning VK_SUCCESS is
valid, as even if the function is given an array in pProperties, it's
filled with zero layers

[1]: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkEnumerateInstanceLayerProperties.html

Signed-off-by: Victor Hermann Chiletto <v at hnn.net.br>
---
 dlls/winevulkan/vulkan.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index d24fcb2f64b..971394eb9dd 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -1065,13 +1065,8 @@ VkResult WINAPI wine_vkEnumerateInstanceLayerProperties(uint32_t *count, VkLayer
 {
     TRACE("%p, %p\n", count, properties);
 
-    if (!properties)
-    {
-        *count = 0;
-        return VK_SUCCESS;
-    }
-
-    return VK_ERROR_LAYER_NOT_PRESENT;
+    *count = 0;
+    return VK_SUCCESS;
 }
 
 VkResult WINAPI wine_vkEnumerateInstanceVersion(uint32_t *version)
-- 
2.30.1




More information about the wine-devel mailing list