Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
12bbfe9b
Commit
12bbfe9b
authored
Mar 29, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Avoid goto in wine_vkCreateInstance().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8fd39cc2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
12 deletions
+8
-12
vulkan.c
dlls/winevulkan/vulkan.c
+8
-12
No files found.
dlls/winevulkan/vulkan.c
View file @
12bbfe9b
...
...
@@ -596,12 +596,10 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
object
=
heap_alloc_zero
(
sizeof
(
*
object
));
if
(
!
object
)
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
{
ERR
(
"Failed to allocate memory for instance
\n
"
);
res
=
VK_ERROR_OUT_OF_HOST_MEMORY
;
goto
err
;
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
object
->
base
.
loader_magic
=
VULKAN_ICD_MAGIC_VALUE
;
...
...
@@ -611,7 +609,8 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
if
(
res
!=
VK_SUCCESS
)
{
ERR
(
"Failed to create instance, res=%d
\n
"
,
res
);
goto
err
;
wine_vk_instance_free
(
object
);
return
res
;
}
/* Load all instance functions we are aware of. Note the loader takes care
...
...
@@ -625,23 +624,20 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
/* Cache physical devices for vkEnumeratePhysicalDevices within the instance as
* each vkPhysicalDevice is a dispatchable object, which means we need to wrap
* the native physical device
and present those
the application.
* the native physical device
s and present those to
the application.
* Cleanup happens as part of wine_vkDestroyInstance.
*/
res
=
wine_vk_instance_load_physical_devices
(
object
);
if
(
res
!=
VK_SUCCESS
)
{
ERR
(
"Failed to cache physical devices, res=%d
\n
"
,
res
);
goto
err
;
ERR
(
"Failed to load physical devices, res=%d
\n
"
,
res
);
wine_vk_instance_free
(
object
);
return
res
;
}
*
instance
=
object
;
TRACE
(
"Done, instance=%p native_instance=%p
\n
"
,
object
,
object
->
instance
);
return
VK_SUCCESS
;
err:
wine_vk_instance_free
(
object
);
return
res
;
}
void
WINAPI
wine_vkDestroyDevice
(
VkDevice
device
,
const
VkAllocationCallbacks
*
allocator
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment