[PATCH] winevulkan: Use VkBase{In, Out}Structure instead of custom structure.

Józef Kucia jkucia at codeweavers.com
Fri Mar 1 01:43:13 CST 2019


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/winevulkan/vulkan.c | 19 ++++++-------------
 1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index 1c721039f2f3..3893f1c85e4d 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -34,17 +34,10 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
  */
 #define WINE_VULKAN_ICD_VERSION 4
 
-/* All Vulkan structures use this structure for the first elements. */
-struct wine_vk_structure_header
-{
-    VkStructureType sType;
-    void *pNext;
-};
-
 #define wine_vk_find_struct(s, t) wine_vk_find_struct_((void *)s, VK_STRUCTURE_TYPE_##t)
 static void *wine_vk_find_struct_(void *s, VkStructureType t)
 {
-    struct wine_vk_structure_header *header;
+    VkBaseOutStructure *header;
 
     for (header = s; header; header = header->pNext)
     {
@@ -250,7 +243,7 @@ static VkResult wine_vk_device_convert_create_info(const VkDeviceCreateInfo *src
      */
     if (src->pNext)
     {
-        const struct wine_vk_structure_header *header;
+        const VkBaseInStructure *header;
 
         dst->pNext = NULL;
         for (header = src->pNext; header; header = header->pNext)
@@ -369,7 +362,7 @@ static VkResult wine_vk_instance_convert_create_info(const VkInstanceCreateInfo
      */
     if (src->pNext)
     {
-        const struct wine_vk_structure_header *header;
+        const VkBaseInStructure *header;
 
         for (header = src->pNext; header; header = header->pNext)
         {
@@ -997,8 +990,8 @@ void WINAPI wine_vkGetDeviceQueue(VkDevice device, uint32_t family_index,
 
 void WINAPI wine_vkGetDeviceQueue2(VkDevice device, const VkDeviceQueueInfo2 *info, VkQueue *queue)
 {
-    const struct wine_vk_structure_header *chain;
     struct VkQueue_T *matching_queue;
+    const VkBaseInStructure *chain;
 
     TRACE("%p, %p, %p\n", device, info, queue);
 
@@ -1111,7 +1104,7 @@ VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t count,
         {
             ERR("Unable to allocate memory for comman buffers!\n");
             res = VK_ERROR_OUT_OF_HOST_MEMORY;
-            goto err;
+            goto done;
         }
 
         for (j = 0; j < num_command_buffers; j++)
@@ -1123,7 +1116,7 @@ VkResult WINAPI wine_vkQueueSubmit(VkQueue queue, uint32_t count,
 
     res = queue->device->funcs.p_vkQueueSubmit(queue->queue, count, submits_host, fence);
 
-err:
+done:
     for (i = 0; i < count; i++)
     {
         heap_free((void *)submits_host[i].pCommandBuffers);
-- 
2.19.2




More information about the wine-devel mailing list