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
c7da2450
Commit
c7da2450
authored
Feb 24, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Introduce a new get_host_surface_extension driver entry.
parent
5db24dbb
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
10 deletions
+37
-10
vulkan.c
dlls/winemac.drv/vulkan.c
+6
-0
vulkan.c
dlls/winevulkan/vulkan.c
+18
-10
vulkan.c
dlls/winewayland.drv/vulkan.c
+6
-0
vulkan.c
dlls/winex11.drv/vulkan.c
+6
-0
vulkan_driver.h
include/wine/vulkan_driver.h
+1
-0
No files found.
dlls/winemac.drv/vulkan.c
View file @
c7da2450
...
...
@@ -361,6 +361,11 @@ static VkResult macdrv_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *
return
res
;
}
static
const
char
*
macdrv_get_host_surface_extension
(
void
)
{
return
pvkCreateMetalSurfaceEXT
?
"VK_EXT_metal_surface"
:
"VK_MVK_macos_surface"
;
}
static
VkSurfaceKHR
macdrv_wine_get_host_surface
(
VkSurfaceKHR
surface
)
{
struct
wine_vk_surface
*
mac_surface
=
surface_from_handle
(
surface
);
...
...
@@ -384,6 +389,7 @@ static const struct vulkan_funcs vulkan_funcs =
macdrv_vkGetSwapchainImagesKHR
,
macdrv_vkQueuePresentKHR
,
macdrv_get_host_surface_extension
,
macdrv_wine_get_host_surface
,
};
...
...
dlls/winevulkan/vulkan.c
View file @
c7da2450
...
...
@@ -571,6 +571,7 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context *
{
VkDebugUtilsMessengerCreateInfoEXT
*
debug_utils_messenger
;
VkDebugReportCallbackCreateInfoEXT
*
debug_report_callback
;
const
char
**
new_extensions
;
VkBaseInStructure
*
header
;
unsigned
int
i
;
...
...
@@ -614,39 +615,46 @@ static VkResult wine_vk_instance_convert_create_info(struct conversion_context *
return
VK_ERROR_LAYER_NOT_PRESENT
;
}
TRACE
(
"Enabled %u instance extensions.
\n
"
,
dst
->
enabledExtensionCount
);
for
(
i
=
0
;
i
<
dst
->
enabledExtensionCount
;
i
++
)
for
(
i
=
0
;
i
<
src
->
enabledExtensionCount
;
i
++
)
{
const
char
*
extension_name
=
dst
->
ppEnabledExtensionNames
[
i
];
const
char
*
extension_name
=
src
->
ppEnabledExtensionNames
[
i
];
TRACE
(
"Extension %u: %s.
\n
"
,
i
,
debugstr_a
(
extension_name
));
if
(
!
wine_vk_instance_extension_supported
(
extension_name
))
{
WARN
(
"Extension %s is not supported.
\n
"
,
debugstr_a
(
extension_name
));
return
VK_ERROR_EXTENSION_NOT_PRESENT
;
}
}
new_extensions
=
conversion_context_alloc
(
ctx
,
(
src
->
enabledExtensionCount
+
2
)
*
sizeof
(
*
src
->
ppEnabledExtensionNames
));
memcpy
(
new_extensions
,
src
->
ppEnabledExtensionNames
,
dst
->
enabledExtensionCount
*
sizeof
(
*
dst
->
ppEnabledExtensionNames
));
dst
->
ppEnabledExtensionNames
=
new_extensions
;
dst
->
enabledExtensionCount
=
src
->
enabledExtensionCount
;
for
(
i
=
0
;
i
<
dst
->
enabledExtensionCount
;
i
++
)
{
const
char
*
extension_name
=
dst
->
ppEnabledExtensionNames
[
i
];
if
(
!
strcmp
(
extension_name
,
"VK_EXT_debug_utils"
)
||
!
strcmp
(
extension_name
,
"VK_EXT_debug_report"
))
{
object
->
enable_wrapper_list
=
VK_TRUE
;
}
if
(
!
strcmp
(
extension_name
,
"VK_KHR_win32_surface"
))
{
new_extensions
[
i
]
=
vk_funcs
->
p_get_host_surface_extension
();
object
->
enable_win32_surface
=
VK_TRUE
;
}
}
if
(
use_external_memory
())
{
const
char
**
new_extensions
;
new_extensions
=
conversion_context_alloc
(
ctx
,
(
dst
->
enabledExtensionCount
+
2
)
*
sizeof
(
*
dst
->
ppEnabledExtensionNames
));
memcpy
(
new_extensions
,
src
->
ppEnabledExtensionNames
,
dst
->
enabledExtensionCount
*
sizeof
(
*
dst
->
ppEnabledExtensionNames
));
new_extensions
[
dst
->
enabledExtensionCount
++
]
=
"VK_KHR_get_physical_device_properties2"
;
new_extensions
[
dst
->
enabledExtensionCount
++
]
=
"VK_KHR_external_memory_capabilities"
;
dst
->
ppEnabledExtensionNames
=
new_extensions
;
}
TRACE
(
"Enabled %u instance extensions.
\n
"
,
dst
->
enabledExtensionCount
);
return
VK_SUCCESS
;
}
...
...
dlls/winewayland.drv/vulkan.c
View file @
c7da2450
...
...
@@ -469,6 +469,11 @@ static VkResult wayland_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR
return
check_queue_present
(
present_info
,
res
);
}
static
const
char
*
wayland_get_host_surface_extension
(
void
)
{
return
"VK_KHR_wayland_surface"
;
}
static
VkSurfaceKHR
wayland_wine_get_host_surface
(
VkSurfaceKHR
surface
)
{
return
wine_vk_surface_from_handle
(
surface
)
->
host_surface
;
...
...
@@ -485,6 +490,7 @@ static const struct vulkan_funcs vulkan_funcs =
.
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
=
wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR
,
.
p_vkGetSwapchainImagesKHR
=
wayland_vkGetSwapchainImagesKHR
,
.
p_vkQueuePresentKHR
=
wayland_vkQueuePresentKHR
,
.
p_get_host_surface_extension
=
wayland_get_host_surface_extension
,
.
p_wine_get_host_surface
=
wayland_wine_get_host_surface
,
};
...
...
dlls/winex11.drv/vulkan.c
View file @
c7da2450
...
...
@@ -396,6 +396,11 @@ static VkResult X11DRV_vkQueuePresentKHR(VkQueue queue, const VkPresentInfoKHR *
return
res
;
}
static
const
char
*
X11DRV_get_host_surface_extension
(
void
)
{
return
"VK_KHR_xlib_surface"
;
}
static
VkSurfaceKHR
X11DRV_wine_get_host_surface
(
VkSurfaceKHR
surface
)
{
struct
wine_vk_surface
*
x11_surface
=
surface_from_handle
(
surface
);
...
...
@@ -419,6 +424,7 @@ static const struct vulkan_funcs vulkan_funcs =
X11DRV_vkGetSwapchainImagesKHR
,
X11DRV_vkQueuePresentKHR
,
X11DRV_get_host_surface_extension
,
X11DRV_wine_get_host_surface
,
};
...
...
include/wine/vulkan_driver.h
View file @
c7da2450
...
...
@@ -42,6 +42,7 @@ struct vulkan_funcs
VkResult
(
*
p_vkQueuePresentKHR
)(
VkQueue
,
const
VkPresentInfoKHR
*
);
/* winevulkan specific functions */
const
char
*
(
*
p_get_host_surface_extension
)(
void
);
VkSurfaceKHR
(
*
p_wine_get_host_surface
)(
VkSurfaceKHR
);
};
...
...
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