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
adb926d5
Commit
adb926d5
authored
Jul 16, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Jul 16, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Generate get_vulkan_driver_*_proc_addr() helper functions.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0cbbab9d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
129 deletions
+94
-129
vulkan.c
dlls/winemac.drv/vulkan.c
+0
-62
make_vulkan
dlls/winevulkan/make_vulkan
+31
-1
vulkan.c
dlls/winex11.drv/vulkan.c
+0
-66
vulkan_driver.h
include/wine/vulkan_driver.h
+63
-0
No files found.
dlls/winemac.drv/vulkan.c
View file @
adb926d5
...
...
@@ -488,73 +488,11 @@ static const struct vulkan_funcs vulkan_funcs =
macdrv_vkQueuePresentKHR
,
};
static
void
*
get_vulkan_driver_device_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateSwapchainKHR"
))
return
vulkan_funcs
->
p_vkCreateSwapchainKHR
;
if
(
!
strcmp
(
name
,
"DestroySwapchainKHR"
))
return
vulkan_funcs
->
p_vkDestroySwapchainKHR
;
if
(
!
strcmp
(
name
,
"GetDeviceProcAddr"
))
return
vulkan_funcs
->
p_vkGetDeviceProcAddr
;
if
(
!
strcmp
(
name
,
"GetSwapchainImagesKHR"
))
return
vulkan_funcs
->
p_vkGetSwapchainImagesKHR
;
if
(
!
strcmp
(
name
,
"QueuePresentKHR"
))
return
vulkan_funcs
->
p_vkQueuePresentKHR
;
return
NULL
;
}
static
void
*
macdrv_get_vk_device_proc_addr
(
const
char
*
name
)
{
return
get_vulkan_driver_device_proc_addr
(
&
vulkan_funcs
,
name
);
}
static
void
*
get_vulkan_driver_instance_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
VkInstance
instance
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateInstance"
))
return
vulkan_funcs
->
p_vkCreateInstance
;
if
(
!
strcmp
(
name
,
"EnumerateInstanceExtensionProperties"
))
return
vulkan_funcs
->
p_vkEnumerateInstanceExtensionProperties
;
if
(
!
instance
)
return
NULL
;
if
(
!
strcmp
(
name
,
"CreateWin32SurfaceKHR"
))
return
vulkan_funcs
->
p_vkCreateWin32SurfaceKHR
;
if
(
!
strcmp
(
name
,
"DestroyInstance"
))
return
vulkan_funcs
->
p_vkDestroyInstance
;
if
(
!
strcmp
(
name
,
"DestroySurfaceKHR"
))
return
vulkan_funcs
->
p_vkDestroySurfaceKHR
;
if
(
!
strcmp
(
name
,
"GetInstanceProcAddr"
))
return
vulkan_funcs
->
p_vkGetInstanceProcAddr
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceCapabilitiesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceFormatsKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceFormatsKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfacePresentModesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfacePresentModesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceSupportKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceWin32PresentationSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
;
name
-=
2
;
return
get_vulkan_driver_device_proc_addr
(
vulkan_funcs
,
name
);
}
static
void
*
macdrv_get_vk_instance_proc_addr
(
VkInstance
instance
,
const
char
*
name
)
{
return
get_vulkan_driver_instance_proc_addr
(
&
vulkan_funcs
,
instance
,
name
);
...
...
dlls/winevulkan/make_vulkan
View file @
adb926d5
...
...
@@ -2235,7 +2235,7 @@ class VkGenerator(object):
f
.
write
(
" */
\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
not
vk_func
.
is_
required
()
or
not
vk_func
.
is_
driver_func
():
if
not
vk_func
.
is_driver_func
():
continue
pfn
=
vk_func
.
pfn
()
...
...
@@ -2246,6 +2246,36 @@ class VkGenerator(object):
f
.
write
(
"};
\n\n
"
)
f
.
write
(
"extern const struct vulkan_funcs * CDECL __wine_get_vulkan_driver(HDC hdc, UINT version);
\n\n
"
)
f
.
write
(
"static inline void *get_vulkan_driver_device_proc_addr(
\n
"
)
f
.
write
(
" const struct vulkan_funcs *vulkan_funcs, const char *name)
\n
{
\n
"
)
f
.
write
(
" if (!name || name[0] != 'v' || name[1] != 'k') return NULL;
\n\n
"
)
f
.
write
(
" name += 2;
\n\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
vk_func
.
is_driver_func
()
and
vk_func
.
is_device_func
():
f
.
write
(
' if (!strcmp(name, "{0}"))
\n
'
.
format
(
vk_func
.
name
[
2
:]))
f
.
write
(
' return vulkan_funcs->p_{0};
\n
'
.
format
(
vk_func
.
name
))
f
.
write
(
"
\n
"
)
f
.
write
(
" return NULL;
\n
}
\n\n
"
)
f
.
write
(
"static inline void *get_vulkan_driver_instance_proc_addr(
\n
"
)
f
.
write
(
" const struct vulkan_funcs *vulkan_funcs, VkInstance instance, const char *name)
\n
{
\n
"
)
f
.
write
(
" if (!name || name[0] != 'v' || name[1] != 'k') return NULL;
\n\n
"
)
f
.
write
(
" name += 2;
\n\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
vk_func
.
is_driver_func
()
and
vk_func
.
is_global_func
()
and
vk_func
.
name
!=
"vkGetInstanceProcAddr"
:
f
.
write
(
' if (!strcmp(name, "{0}"))
\n
'
.
format
(
vk_func
.
name
[
2
:]))
f
.
write
(
' return vulkan_funcs->p_{0};
\n
'
.
format
(
vk_func
.
name
))
f
.
write
(
"
\n
"
)
f
.
write
(
" if (!instance) return NULL;
\n\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
vk_func
.
is_driver_func
()
and
vk_func
.
is_instance_func
():
f
.
write
(
' if (!strcmp(name, "{0}"))
\n
'
.
format
(
vk_func
.
name
[
2
:]))
f
.
write
(
' return vulkan_funcs->p_{0};
\n
'
.
format
(
vk_func
.
name
))
f
.
write
(
"
\n
"
)
f
.
write
(
" name -= 2;
\n\n
"
)
f
.
write
(
" return get_vulkan_driver_device_proc_addr(vulkan_funcs, name);
\n
}
\n\n
"
)
f
.
write
(
"#endif /* __WINE_VULKAN_DRIVER_H */
\n
"
)
def
generate_vulkan_spec
(
self
,
f
):
...
...
dlls/winex11.drv/vulkan.c
View file @
adb926d5
...
...
@@ -540,77 +540,11 @@ static const struct vulkan_funcs vulkan_funcs =
X11DRV_vkQueuePresentKHR
,
};
static
void
*
get_vulkan_driver_device_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateSwapchainKHR"
))
return
vulkan_funcs
->
p_vkCreateSwapchainKHR
;
if
(
!
strcmp
(
name
,
"DestroySwapchainKHR"
))
return
vulkan_funcs
->
p_vkDestroySwapchainKHR
;
if
(
!
strcmp
(
name
,
"GetDeviceGroupSurfacePresentModesKHR"
))
return
vulkan_funcs
->
p_vkGetDeviceGroupSurfacePresentModesKHR
;
if
(
!
strcmp
(
name
,
"GetDeviceProcAddr"
))
return
vulkan_funcs
->
p_vkGetDeviceProcAddr
;
if
(
!
strcmp
(
name
,
"GetSwapchainImagesKHR"
))
return
vulkan_funcs
->
p_vkGetSwapchainImagesKHR
;
if
(
!
strcmp
(
name
,
"QueuePresentKHR"
))
return
vulkan_funcs
->
p_vkQueuePresentKHR
;
return
NULL
;
}
static
void
*
X11DRV_get_vk_device_proc_addr
(
const
char
*
name
)
{
return
get_vulkan_driver_device_proc_addr
(
&
vulkan_funcs
,
name
);
}
static
void
*
get_vulkan_driver_instance_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
VkInstance
instance
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateInstance"
))
return
vulkan_funcs
->
p_vkCreateInstance
;
if
(
!
strcmp
(
name
,
"EnumerateInstanceExtensionProperties"
))
return
vulkan_funcs
->
p_vkEnumerateInstanceExtensionProperties
;
if
(
!
instance
)
return
NULL
;
if
(
!
strcmp
(
name
,
"CreateWin32SurfaceKHR"
))
return
vulkan_funcs
->
p_vkCreateWin32SurfaceKHR
;
if
(
!
strcmp
(
name
,
"DestroyInstance"
))
return
vulkan_funcs
->
p_vkDestroyInstance
;
if
(
!
strcmp
(
name
,
"DestroySurfaceKHR"
))
return
vulkan_funcs
->
p_vkDestroySurfaceKHR
;
if
(
!
strcmp
(
name
,
"GetInstanceProcAddr"
))
return
vulkan_funcs
->
p_vkGetInstanceProcAddr
;
if
(
!
strcmp
(
name
,
"GetPhysicalDevicePresentRectanglesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDevicePresentRectanglesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceCapabilitiesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceFormatsKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceFormatsKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfacePresentModesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfacePresentModesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceSupportKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceWin32PresentationSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
;
name
-=
2
;
return
get_vulkan_driver_device_proc_addr
(
vulkan_funcs
,
name
);
}
static
void
*
X11DRV_get_vk_instance_proc_addr
(
VkInstance
instance
,
const
char
*
name
)
{
return
get_vulkan_driver_instance_proc_addr
(
&
vulkan_funcs
,
instance
,
name
);
...
...
include/wine/vulkan_driver.h
View file @
adb926d5
...
...
@@ -69,4 +69,67 @@ struct vulkan_funcs
extern
const
struct
vulkan_funcs
*
CDECL
__wine_get_vulkan_driver
(
HDC
hdc
,
UINT
version
);
static
inline
void
*
get_vulkan_driver_device_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateSwapchainKHR"
))
return
vulkan_funcs
->
p_vkCreateSwapchainKHR
;
if
(
!
strcmp
(
name
,
"DestroySwapchainKHR"
))
return
vulkan_funcs
->
p_vkDestroySwapchainKHR
;
if
(
!
strcmp
(
name
,
"GetDeviceGroupSurfacePresentModesKHR"
))
return
vulkan_funcs
->
p_vkGetDeviceGroupSurfacePresentModesKHR
;
if
(
!
strcmp
(
name
,
"GetDeviceProcAddr"
))
return
vulkan_funcs
->
p_vkGetDeviceProcAddr
;
if
(
!
strcmp
(
name
,
"GetSwapchainImagesKHR"
))
return
vulkan_funcs
->
p_vkGetSwapchainImagesKHR
;
if
(
!
strcmp
(
name
,
"QueuePresentKHR"
))
return
vulkan_funcs
->
p_vkQueuePresentKHR
;
return
NULL
;
}
static
inline
void
*
get_vulkan_driver_instance_proc_addr
(
const
struct
vulkan_funcs
*
vulkan_funcs
,
VkInstance
instance
,
const
char
*
name
)
{
if
(
!
name
||
name
[
0
]
!=
'v'
||
name
[
1
]
!=
'k'
)
return
NULL
;
name
+=
2
;
if
(
!
strcmp
(
name
,
"CreateInstance"
))
return
vulkan_funcs
->
p_vkCreateInstance
;
if
(
!
strcmp
(
name
,
"EnumerateInstanceExtensionProperties"
))
return
vulkan_funcs
->
p_vkEnumerateInstanceExtensionProperties
;
if
(
!
instance
)
return
NULL
;
if
(
!
strcmp
(
name
,
"CreateWin32SurfaceKHR"
))
return
vulkan_funcs
->
p_vkCreateWin32SurfaceKHR
;
if
(
!
strcmp
(
name
,
"DestroyInstance"
))
return
vulkan_funcs
->
p_vkDestroyInstance
;
if
(
!
strcmp
(
name
,
"DestroySurfaceKHR"
))
return
vulkan_funcs
->
p_vkDestroySurfaceKHR
;
if
(
!
strcmp
(
name
,
"GetInstanceProcAddr"
))
return
vulkan_funcs
->
p_vkGetInstanceProcAddr
;
if
(
!
strcmp
(
name
,
"GetPhysicalDevicePresentRectanglesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDevicePresentRectanglesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceCapabilitiesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceCapabilitiesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceFormatsKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceFormatsKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfacePresentModesKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfacePresentModesKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceSurfaceSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceSurfaceSupportKHR
;
if
(
!
strcmp
(
name
,
"GetPhysicalDeviceWin32PresentationSupportKHR"
))
return
vulkan_funcs
->
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
;
name
-=
2
;
return
get_vulkan_driver_device_proc_addr
(
vulkan_funcs
,
name
);
}
#endif
/* __WINE_VULKAN_DRIVER_H */
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