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
d36ecbe8
Commit
d36ecbe8
authored
Jul 12, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Jul 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vulkan-1/tests: Introduce for_each_device() helper.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b27b3aea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
vulkan.c
dlls/vulkan-1/tests/vulkan.c
+17
-14
No files found.
dlls/vulkan-1/tests/vulkan.c
View file @
d36ecbe8
...
...
@@ -38,10 +38,23 @@ static VkResult create_instance(uint32_t extension_count,
return
vkCreateInstance
(
&
create_info
,
NULL
,
vk_instance
);
}
static
void
test_enumerate_physical_devices
(
void
)
static
void
enumerate_physical_device
(
VkPhysicalDevice
vk_physical_device
)
{
VkPhysicalDevice
*
vk_physical_devices
;
VkPhysicalDeviceProperties
properties
;
vkGetPhysicalDeviceProperties
(
vk_physical_device
,
&
properties
);
trace
(
"Device '%s', %#x:%#x, driver version %u.%u.%u (%#x), api version %u.%u.%u.
\n
"
,
properties
.
deviceName
,
properties
.
vendorID
,
properties
.
deviceID
,
VK_VERSION_MAJOR
(
properties
.
driverVersion
),
VK_VERSION_MINOR
(
properties
.
driverVersion
),
VK_VERSION_PATCH
(
properties
.
driverVersion
),
properties
.
driverVersion
,
VK_VERSION_MAJOR
(
properties
.
apiVersion
),
VK_VERSION_MINOR
(
properties
.
apiVersion
),
VK_VERSION_PATCH
(
properties
.
apiVersion
));
}
static
void
for_each_device
(
void
(
*
test_func
)(
VkPhysicalDevice
))
{
VkPhysicalDevice
*
vk_physical_devices
;
VkInstance
vk_instance
;
unsigned
int
i
;
uint32_t
count
;
...
...
@@ -63,23 +76,13 @@ static void test_enumerate_physical_devices(void)
return
;
}
trace
(
"Got %u physical device(s).
\n
"
,
count
);
vk_physical_devices
=
heap_calloc
(
count
,
sizeof
(
*
vk_physical_devices
));
ok
(
!!
vk_physical_devices
,
"Failed to allocate memory.
\n
"
);
vr
=
vkEnumeratePhysicalDevices
(
vk_instance
,
&
count
,
vk_physical_devices
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected VkResult %d.
\n
"
,
vr
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
vkGetPhysicalDeviceProperties
(
vk_physical_devices
[
i
],
&
properties
);
trace
(
"Device '%s', %#x:%#x, driver version %u.%u.%u (%#x), api version %u.%u.%u.
\n
"
,
properties
.
deviceName
,
properties
.
vendorID
,
properties
.
deviceID
,
VK_VERSION_MAJOR
(
properties
.
driverVersion
),
VK_VERSION_MINOR
(
properties
.
driverVersion
),
VK_VERSION_PATCH
(
properties
.
driverVersion
),
properties
.
driverVersion
,
VK_VERSION_MAJOR
(
properties
.
apiVersion
),
VK_VERSION_MINOR
(
properties
.
apiVersion
),
VK_VERSION_PATCH
(
properties
.
apiVersion
));
}
test_func
(
vk_physical_devices
[
i
]);
heap_free
(
vk_physical_devices
);
...
...
@@ -88,5 +91,5 @@ static void test_enumerate_physical_devices(void)
START_TEST
(
vulkan
)
{
test_enumerate_physical_devices
(
);
for_each_device
(
enumerate_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