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
7c0ddacd
Commit
7c0ddacd
authored
Nov 26, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Jan 31, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vulkan-1/tests: Test VK_KHR_win32_surface with windows in various states.
parent
beb75c50
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
135 additions
and
2 deletions
+135
-2
vulkan.c
dlls/vulkan-1/tests/vulkan.c
+135
-2
No files found.
dlls/vulkan-1/tests/vulkan.c
View file @
7c0ddacd
...
@@ -497,7 +497,11 @@ static void test_win32_surface_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_
...
@@ -497,7 +497,11 @@ static void test_win32_surface_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
vr
=
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
(
vk_physical_device
,
surface
,
&
surf_caps
);
vr
=
vkGetPhysicalDeviceSurfaceCapabilitiesKHR
(
vk_physical_device
,
surface
,
&
surf_caps
);
ok
(
vr
,
"vkGetPhysicalDeviceSurfaceCapabilitiesKHR succeeded.
\n
"
);
if
(
!
IsWindow
(
hwnd
))
ok
(
vr
==
VK_ERROR_SURFACE_LOST_KHR
/* Nvidia */
||
vr
==
VK_ERROR_UNKNOWN
/* AMD */
,
"Got unexpected vr %d.
\n
"
,
vr
);
else
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
count
=
0
;
count
=
0
;
vr
=
pvkGetPhysicalDeviceSurfacePresentModesKHR
(
vk_physical_device
,
surface
,
&
count
,
NULL
);
vr
=
pvkGetPhysicalDeviceSurfacePresentModesKHR
(
vk_physical_device
,
surface
,
&
count
,
NULL
);
...
@@ -515,7 +519,7 @@ static void test_win32_surface_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_
...
@@ -515,7 +519,7 @@ static void test_win32_surface_hwnd(VkInstance vk_instance, VkPhysicalDevice vk_
memset
(
&
rect
,
0xcc
,
sizeof
(
rect
));
memset
(
&
rect
,
0xcc
,
sizeof
(
rect
));
vr
=
pvkGetPhysicalDevicePresentRectanglesKHR
(
vk_physical_device
,
surface
,
&
count
,
&
rect
);
vr
=
pvkGetPhysicalDevicePresentRectanglesKHR
(
vk_physical_device
,
surface
,
&
count
,
&
rect
);
todo_wine
todo_wine
_if
(
!
IsWindow
(
hwnd
))
ok
(
vr
==
VK_SUCCESS
/* Nvidia */
||
vr
==
VK_ERROR_UNKNOWN
/* AMD */
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
vr
==
VK_SUCCESS
/* Nvidia */
||
vr
==
VK_ERROR_UNKNOWN
/* AMD */
,
"Got unexpected vr %d.
\n
"
,
vr
);
if
(
vr
==
VK_SUCCESS
)
if
(
vr
==
VK_SUCCESS
)
{
{
...
@@ -544,6 +548,7 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
...
@@ -544,6 +548,7 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
VkSurfaceKHR
surface
;
VkSurfaceKHR
surface
;
VkDevice
device
;
VkDevice
device
;
VkResult
vr
;
VkResult
vr
;
HWND
hwnd
;
vr
=
create_device
(
physical_device
,
ARRAY_SIZE
(
device_extensions
),
device_extensions
,
NULL
,
&
device
);
vr
=
create_device
(
physical_device
,
ARRAY_SIZE
(
device_extensions
),
device_extensions
,
NULL
,
&
device
);
if
(
vr
!=
VK_SUCCESS
)
/* Wine testbot is missing VK_KHR_device_group */
if
(
vr
!=
VK_SUCCESS
)
/* Wine testbot is missing VK_KHR_device_group */
...
@@ -564,6 +569,134 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
...
@@ -564,6 +569,134 @@ static void test_win32_surface(VkInstance instance, VkPhysicalDevice physical_de
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
winetest_pop_context
();
winetest_pop_context
();
/* test normal window */
winetest_push_context
(
"created"
);
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExW failed, error %lu
\n
"
,
GetLastError
());
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
DestroyWindow
(
hwnd
);
winetest_pop_context
();
/* test destroyed window */
winetest_push_context
(
"destroyed"
);
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExW failed, error %lu
\n
"
,
GetLastError
());
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
DestroyWindow
(
hwnd
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
winetest_pop_context
();
/* test resized window */
winetest_push_context
(
"resized"
);
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExW failed, error %lu
\n
"
,
GetLastError
());
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
50
,
50
,
SWP_NOMOVE
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
DestroyWindow
(
hwnd
);
winetest_pop_context
();
/* test hidden window */
winetest_push_context
(
"hidden"
);
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExW failed, error %lu
\n
"
,
GetLastError
());
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
ShowWindow
(
hwnd
,
SW_HIDE
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
DestroyWindow
(
hwnd
);
winetest_pop_context
();
/* tests minimized window */
winetest_push_context
(
"minimized"
);
hwnd
=
CreateWindowW
(
L"static"
,
L"static"
,
WS_OVERLAPPEDWINDOW
|
WS_VISIBLE
,
100
,
100
,
200
,
200
,
0
,
0
,
0
,
NULL
);
ok
(
hwnd
!=
0
,
"CreateWindowExW failed, error %lu
\n
"
,
GetLastError
());
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
ShowWindow
(
hwnd
,
SW_MINIMIZE
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
DestroyWindow
(
hwnd
);
winetest_pop_context
();
/* works on Windows, crashes on Wine */
if
(
0
)
{
/* test desktop window */
winetest_push_context
(
"desktop"
);
hwnd
=
GetDesktopWindow
();
surface
=
0xdeadbeef
;
create_info
.
hwnd
=
hwnd
;
vr
=
vkCreateWin32SurfaceKHR
(
instance
,
&
create_info
,
NULL
,
&
surface
);
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
ok
(
surface
!=
0xdeadbeef
,
"Surface not created.
\n
"
);
test_win32_surface_hwnd
(
instance
,
physical_device
,
device
,
surface
,
hwnd
);
vkDestroySurfaceKHR
(
instance
,
surface
,
NULL
);
winetest_pop_context
();
}
vkDestroyDevice
(
device
,
NULL
);
vkDestroyDevice
(
device
,
NULL
);
}
}
...
...
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