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
1585b50f
Commit
1585b50f
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: Simplify vkEnumerateDeviceExtensionProperties().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
efddcedd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
33 deletions
+12
-33
vulkan.c
dlls/winevulkan/vulkan.c
+10
-31
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+2
-2
No files found.
dlls/winevulkan/vulkan.c
View file @
1585b50f
...
...
@@ -54,7 +54,7 @@ static void wine_vk_physical_device_free(struct VkPhysicalDevice_T *phys_dev)
if
(
!
phys_dev
)
return
;
heap_free
(
phys_dev
->
propertie
s
);
heap_free
(
phys_dev
->
extension
s
);
heap_free
(
phys_dev
);
}
...
...
@@ -115,10 +115,9 @@ static struct VkPhysicalDevice_T *wine_vk_physical_device_alloc(struct VkInstanc
TRACE
(
"Host supported extensions %u, Wine supported extensions %u
\n
"
,
num_host_properties
,
num_properties
);
object
->
properties
=
heap_calloc
(
num_properties
,
sizeof
(
*
object
->
properties
));
if
(
!
object
->
properties
)
if
(
!
(
object
->
extensions
=
heap_calloc
(
num_properties
,
sizeof
(
*
object
->
extensions
))))
{
ERR
(
"Failed to allocate memory for device
propertie
s!
\n
"
);
ERR
(
"Failed to allocate memory for device
extension
s!
\n
"
);
goto
err
;
}
...
...
@@ -126,11 +125,11 @@ static struct VkPhysicalDevice_T *wine_vk_physical_device_alloc(struct VkInstanc
{
if
(
wine_vk_device_extension_supported
(
host_properties
[
i
].
extensionName
))
{
memcpy
(
&
object
->
properties
[
j
],
&
host_properties
[
i
],
sizeof
(
*
object
->
properties
))
;
object
->
extensions
[
j
]
=
host_properties
[
i
]
;
j
++
;
}
}
object
->
num_properties
=
num_properties
;
object
->
extension_count
=
num_properties
;
heap_free
(
host_properties
);
return
object
;
...
...
@@ -672,9 +671,6 @@ void WINAPI wine_vkDestroyInstance(VkInstance instance, const VkAllocationCallba
VkResult
WINAPI
wine_vkEnumerateDeviceExtensionProperties
(
VkPhysicalDevice
phys_dev
,
const
char
*
layer_name
,
uint32_t
*
count
,
VkExtensionProperties
*
properties
)
{
VkResult
res
;
unsigned
int
i
,
num_copies
;
TRACE
(
"%p, %p, %p, %p
\n
"
,
phys_dev
,
layer_name
,
count
,
properties
);
/* This shouldn't get called with layer_name set, the ICD loader prevents it. */
...
...
@@ -686,32 +682,15 @@ VkResult WINAPI wine_vkEnumerateDeviceExtensionProperties(VkPhysicalDevice phys_
if
(
!
properties
)
{
*
count
=
phys_dev
->
num_properties
;
*
count
=
phys_dev
->
extension_count
;
return
VK_SUCCESS
;
}
if
(
*
count
<
phys_dev
->
num_properties
)
{
/* Incomplete is a type of success used to signal the application
* that not all devices got copied.
*/
num_copies
=
*
count
;
res
=
VK_INCOMPLETE
;
}
else
{
num_copies
=
phys_dev
->
num_properties
;
res
=
VK_SUCCESS
;
}
for
(
i
=
0
;
i
<
num_copies
;
i
++
)
{
memcpy
(
&
properties
[
i
],
&
phys_dev
->
properties
[
i
],
sizeof
(
phys_dev
->
properties
[
i
]));
}
*
count
=
num_copies
;
*
count
=
min
(
*
count
,
phys_dev
->
extension_count
);
memcpy
(
properties
,
phys_dev
->
extensions
,
*
count
*
sizeof
(
*
properties
));
TRACE
(
"Re
sult %d, extensions copied %u
\n
"
,
res
,
num_copies
);
return
res
;
TRACE
(
"Re
turning %u extensions.
\n
"
,
*
count
);
return
*
count
<
phys_dev
->
extension_count
?
VK_INCOMPLETE
:
VK_SUCCESS
;
}
VkResult
WINAPI
wine_vkEnumerateInstanceExtensionProperties
(
const
char
*
layer_name
,
...
...
dlls/winevulkan/vulkan_private.h
View file @
1585b50f
...
...
@@ -86,8 +86,8 @@ struct VkPhysicalDevice_T
struct
wine_vk_base
base
;
struct
VkInstance_T
*
instance
;
/* parent */
uint32_t
num_properties
;
VkExtensionProperties
*
propertie
s
;
uint32_t
extension_count
;
VkExtensionProperties
*
extension
s
;
VkPhysicalDevice
phys_dev
;
/* native physical device */
};
...
...
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