Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fotios Valasiadis
wine
Commits
1db35221
Commit
1db35221
authored
1 year ago
by
Rémi Bernon
Committed by
Alexandre Julliard
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
winewayland: Get rid of the now unnecessary surface wrapper.
parent
f30f8a42
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/winewayland.drv/vulkan.c
+20
-45
20 additions, 45 deletions
dlls/winewayland.drv/vulkan.c
with
20 additions
and
45 deletions
dlls/winewayland.drv/vulkan.c
+
20
−
45
View file @
1db35221
...
...
@@ -58,76 +58,54 @@ static VkBool32 (*pvkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalD
static
const
struct
vulkan_driver_funcs
wayland_vulkan_driver_funcs
;
st
ruct
wine_vk_surface
st
atic
HWND
wine_vk_surface
_get_hwnd
(
struct
wayland_client_surface
*
client
)
{
struct
wayland_client_surface
*
client
;
};
static
HWND
wine_vk_surface_get_hwnd
(
struct
wine_vk_surface
*
wine_vk_surface
)
{
return
wl_surface_get_user_data
(
wine_vk_surface
->
client
->
wl_surface
);
return
wl_surface_get_user_data
(
client
->
wl_surface
);
}
static
void
wine_vk_surface_destroy
(
struct
w
ine_vk_surface
*
wine_vk_surface
)
static
void
wine_vk_surface_destroy
(
struct
w
ayland_client_surface
*
client
)
{
if
(
wine_vk_surface
->
client
)
{
HWND
hwnd
=
wine_vk_surface_get_hwnd
(
wine_vk_surface
);
struct
wayland_surface
*
wayland_surface
=
wayland_surface_lock_hwnd
(
hwnd
);
HWND
hwnd
=
wine_vk_surface_get_hwnd
(
client
);
struct
wayland_surface
*
wayland_surface
=
wayland_surface_lock_hwnd
(
hwnd
);
if
(
wayland_client_surface_release
(
wine_vk_surface
->
client
)
&&
wayland_surface
)
{
wayland_surface
->
client
=
NULL
;
}
if
(
wayland_surface
)
pthread_mutex_unlock
(
&
wayland_surface
->
mutex
);
if
(
wayland_client_surface_release
(
client
)
&&
wayland_surface
)
{
wayland_surface
->
client
=
NULL
;
}
free
(
wine_vk
_surface
);
if
(
wayland_surface
)
pthread_mutex_unlock
(
&
wayland
_surface
->
mutex
);
}
static
VkResult
wayland_vulkan_surface_create
(
HWND
hwnd
,
VkInstance
instance
,
VkSurfaceKHR
*
surface
,
void
**
private
)
{
VkResult
res
;
VkWaylandSurfaceCreateInfoKHR
create_info_host
;
struct
wine_vk_surface
*
wine_vk_surface
;
struct
wayland_surface
*
wayland_surface
;
struct
wayland_client_surface
*
client
;
TRACE
(
"%p %p %p %p
\n
"
,
hwnd
,
instance
,
surface
,
private
);
wine_vk_surface
=
calloc
(
1
,
sizeof
(
*
wine_vk_surface
));
if
(
!
wine_vk_surface
)
{
ERR
(
"Failed to allocate memory for wayland vulkan surface
\n
"
);
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
wayland_surface
=
wayland_surface_lock_hwnd
(
hwnd
);
if
(
!
wayland_surface
)
{
ERR
(
"Failed to find wayland surface for hwnd=%p
\n
"
,
hwnd
);
/* VK_KHR_win32_surface only allows out of host and device memory as errors. */
res
=
VK_ERROR_OUT_OF_HOST_MEMORY
;
goto
err
;
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
wine_vk_surface
->
client
=
wayland_surface_get_client
(
wayland_surface
);
client
=
wayland_surface_get_client
(
wayland_surface
);
pthread_mutex_unlock
(
&
wayland_surface
->
mutex
);
if
(
!
wine_vk_surface
->
client
)
if
(
!
client
)
{
ERR
(
"Failed to create client surface for hwnd=%p
\n
"
,
hwnd
);
/* VK_KHR_win32_surface only allows out of host and device memory as errors. */
res
=
VK_ERROR_OUT_OF_HOST_MEMORY
;
goto
err
;
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
}
create_info_host
.
sType
=
VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR
;
create_info_host
.
pNext
=
NULL
;
create_info_host
.
flags
=
0
;
/* reserved */
create_info_host
.
display
=
process_wayland
.
wl_display
;
create_info_host
.
surface
=
wine_vk_surface
->
client
->
wl_surface
;
create_info_host
.
surface
=
client
->
wl_surface
;
res
=
pvkCreateWaylandSurfaceKHR
(
instance
,
&
create_info_host
,
NULL
/* allocator */
,
...
...
@@ -135,26 +113,23 @@ static VkResult wayland_vulkan_surface_create(HWND hwnd, VkInstance instance, Vk
if
(
res
!=
VK_SUCCESS
)
{
ERR
(
"Failed to create vulkan wayland surface, res=%d
\n
"
,
res
);
goto
err
;
wine_vk_surface_destroy
(
client
);
return
res
;
}
*
private
=
wine_vk_surface
;
*
private
=
client
;
TRACE
(
"Created surface=0x%s, private=%p
\n
"
,
wine_dbgstr_longlong
(
*
surface
),
*
private
);
return
VK_SUCCESS
;
err:
wine_vk_surface_destroy
(
wine_vk_surface
);
return
res
;
}
static
void
wayland_vulkan_surface_destroy
(
HWND
hwnd
,
void
*
private
)
{
struct
w
ine_vk_surface
*
wine_vk_surface
=
private
;
struct
w
ayland_client_surface
*
client
=
private
;
TRACE
(
"%p %p
\n
"
,
hwnd
,
private
);
wine_vk_surface_destroy
(
wine_vk_surface
);
wine_vk_surface_destroy
(
client
);
}
static
void
wayland_vulkan_surface_presented
(
HWND
hwnd
,
VkResult
result
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment