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
c09a4145
Commit
c09a4145
authored
Nov 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Pass type as uint32_t to wine_vk_unwrap_handle.
Fixes -Wenum-conversion warning when VkDebugReportObjectTypeEXT is used as a type.
parent
e8af92ac
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
48 deletions
+47
-48
make_vulkan
dlls/winevulkan/make_vulkan
+20
-20
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+0
-1
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+27
-27
No files found.
dlls/winevulkan/make_vulkan
View file @
c09a4145
...
...
@@ -2349,6 +2349,26 @@ class VkGenerator(object):
f
.
write
(
"WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
\n\n
"
)
f
.
write
(
"static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle)
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" switch(type)
\n
"
)
f
.
write
(
" {
\n
"
)
for
handle
in
self
.
registry
.
handles
:
if
not
handle
.
is_required
()
or
not
handle
.
is_wrapped
()
or
handle
.
is_alias
():
continue
f
.
write
(
" case {}:
\n
"
.
format
(
handle
.
object_type
))
if
handle
.
is_dispatchable
():
f
.
write
(
" return (uint64_t) (uintptr_t) "
)
f
.
write
(
handle
.
native_handle
(
"(({}) (uintptr_t) handle)"
.
format
(
handle
.
name
)))
else
:
f
.
write
(
" return (uint64_t) "
)
f
.
write
(
handle
.
native_handle
(
"handle"
))
f
.
write
(
";
\n
"
);
f
.
write
(
" default:
\n
"
)
f
.
write
(
" return handle;
\n
"
)
f
.
write
(
" }
\n
"
)
f
.
write
(
"}
\n\n
"
)
# Generate any conversion helper functions.
for
conv
in
self
.
conversions
:
f
.
write
(
conv
.
definition
())
...
...
@@ -2426,26 +2446,6 @@ class VkGenerator(object):
f
.
write
(
";
\n
"
)
f
.
write
(
"}
\n\n
"
)
f
.
write
(
"uint64_t wine_vk_unwrap_handle(VkObjectType type, uint64_t handle)
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" switch(type)
\n
"
)
f
.
write
(
" {
\n
"
)
for
handle
in
self
.
registry
.
handles
:
if
not
handle
.
is_required
()
or
not
handle
.
is_wrapped
()
or
handle
.
is_alias
():
continue
f
.
write
(
" case {}:
\n
"
.
format
(
handle
.
object_type
))
if
handle
.
is_dispatchable
():
f
.
write
(
" return (uint64_t) (uintptr_t) "
)
f
.
write
(
handle
.
native_handle
(
"(({}) (uintptr_t) handle)"
.
format
(
handle
.
name
)))
else
:
f
.
write
(
" return (uint64_t) "
)
f
.
write
(
handle
.
native_handle
(
"handle"
))
f
.
write
(
";
\n
"
);
f
.
write
(
" default:
\n
"
)
f
.
write
(
" return handle;
\n
"
)
f
.
write
(
" }
\n
"
)
f
.
write
(
"}
\n\n
"
)
f
.
write
(
"#if !defined(USE_STRUCT_CONVERSION)
\n\n
"
)
f
.
write
(
"const unixlib_entry_t __wine_unix_call_funcs[] =
\n
"
)
...
...
dlls/winevulkan/vulkan_private.h
View file @
c09a4145
...
...
@@ -230,7 +230,6 @@ BOOL wine_vk_device_extension_supported(const char *name) DECLSPEC_HIDDEN;
BOOL
wine_vk_instance_extension_supported
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
BOOL
wine_vk_is_type_wrapped
(
VkObjectType
type
)
DECLSPEC_HIDDEN
;
uint64_t
wine_vk_unwrap_handle
(
VkObjectType
type
,
uint64_t
handle
)
DECLSPEC_HIDDEN
;
NTSTATUS
init_vulkan
(
void
*
args
)
DECLSPEC_HIDDEN
;
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
c09a4145
...
...
@@ -21,6 +21,33 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
vulkan
);
static
uint64_t
wine_vk_unwrap_handle
(
uint32_t
type
,
uint64_t
handle
)
{
switch
(
type
)
{
case
VK_OBJECT_TYPE_COMMAND_BUFFER
:
return
(
uint64_t
)
(
uintptr_t
)
wine_cmd_buffer_from_handle
(((
VkCommandBuffer
)
(
uintptr_t
)
handle
))
->
command_buffer
;
case
VK_OBJECT_TYPE_COMMAND_POOL
:
return
(
uint64_t
)
wine_cmd_pool_from_handle
(
handle
)
->
command_pool
;
case
VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT
:
return
(
uint64_t
)
wine_debug_report_callback_from_handle
(
handle
)
->
debug_callback
;
case
VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT
:
return
(
uint64_t
)
wine_debug_utils_messenger_from_handle
(
handle
)
->
debug_messenger
;
case
VK_OBJECT_TYPE_DEVICE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_device_from_handle
(((
VkDevice
)
(
uintptr_t
)
handle
))
->
device
;
case
VK_OBJECT_TYPE_INSTANCE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_instance_from_handle
(((
VkInstance
)
(
uintptr_t
)
handle
))
->
instance
;
case
VK_OBJECT_TYPE_PHYSICAL_DEVICE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_phys_dev_from_handle
(((
VkPhysicalDevice
)
(
uintptr_t
)
handle
))
->
phys_dev
;
case
VK_OBJECT_TYPE_QUEUE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_queue_from_handle
(((
VkQueue
)
(
uintptr_t
)
handle
))
->
queue
;
case
VK_OBJECT_TYPE_SURFACE_KHR
:
return
(
uint64_t
)
wine_surface_from_handle
(
handle
)
->
surface
;
default:
return
handle
;
}
}
#if defined(USE_STRUCT_CONVERSION)
static
inline
void
convert_VkAcquireNextImageInfoKHR_win32_to_host
(
const
VkAcquireNextImageInfoKHR
*
in
,
VkAcquireNextImageInfoKHR_host
*
out
)
{
...
...
@@ -19636,33 +19663,6 @@ BOOL wine_vk_is_type_wrapped(VkObjectType type)
type
==
VK_OBJECT_TYPE_SURFACE_KHR
;
}
uint64_t
wine_vk_unwrap_handle
(
VkObjectType
type
,
uint64_t
handle
)
{
switch
(
type
)
{
case
VK_OBJECT_TYPE_COMMAND_BUFFER
:
return
(
uint64_t
)
(
uintptr_t
)
wine_cmd_buffer_from_handle
(((
VkCommandBuffer
)
(
uintptr_t
)
handle
))
->
command_buffer
;
case
VK_OBJECT_TYPE_COMMAND_POOL
:
return
(
uint64_t
)
wine_cmd_pool_from_handle
(
handle
)
->
command_pool
;
case
VK_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT
:
return
(
uint64_t
)
wine_debug_report_callback_from_handle
(
handle
)
->
debug_callback
;
case
VK_OBJECT_TYPE_DEBUG_UTILS_MESSENGER_EXT
:
return
(
uint64_t
)
wine_debug_utils_messenger_from_handle
(
handle
)
->
debug_messenger
;
case
VK_OBJECT_TYPE_DEVICE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_device_from_handle
(((
VkDevice
)
(
uintptr_t
)
handle
))
->
device
;
case
VK_OBJECT_TYPE_INSTANCE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_instance_from_handle
(((
VkInstance
)
(
uintptr_t
)
handle
))
->
instance
;
case
VK_OBJECT_TYPE_PHYSICAL_DEVICE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_phys_dev_from_handle
(((
VkPhysicalDevice
)
(
uintptr_t
)
handle
))
->
phys_dev
;
case
VK_OBJECT_TYPE_QUEUE
:
return
(
uint64_t
)
(
uintptr_t
)
wine_queue_from_handle
(((
VkQueue
)
(
uintptr_t
)
handle
))
->
queue
;
case
VK_OBJECT_TYPE_SURFACE_KHR
:
return
(
uint64_t
)
wine_surface_from_handle
(
handle
)
->
surface
;
default:
return
handle
;
}
}
#if !defined(USE_STRUCT_CONVERSION)
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
...
...
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