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
bfc3a286
Commit
bfc3a286
authored
Dec 09, 2021
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 09, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Use KeUserModeCallback for debug callbacks.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1facdbbd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
15 deletions
+81
-15
user_main.c
dlls/user32/user_main.c
+1
-1
loader.c
dlls/winevulkan/loader.c
+18
-1
vulkan.c
dlls/winevulkan/vulkan.c
+33
-13
vulkan_loader.h
dlls/winevulkan/vulkan_loader.h
+26
-0
ntuser.h
include/ntuser.h
+3
-0
No files found.
dlls/user32/user_main.c
View file @
bfc3a286
...
...
@@ -214,7 +214,7 @@ static void dpiaware_init(void)
}
static
const
void
*
kernel_callback_table
[]
=
static
const
void
*
kernel_callback_table
[
NtUserCallCount
]
=
{
User32CallEnumDisplayMonitor
,
};
...
...
dlls/winevulkan/loader.c
View file @
bfc3a286
...
...
@@ -19,7 +19,7 @@
#include "vulkan_loader.h"
#include "winreg.h"
#include "
win
user.h"
#include "
nt
user.h"
#include "initguid.h"
#include "devguid.h"
#include "setupapi.h"
...
...
@@ -373,8 +373,21 @@ void WINAPI vkGetPhysicalDeviceProperties2KHR(VkPhysicalDevice phys_dev,
fill_luid_property
(
properties2
);
}
static
BOOL
WINAPI
call_vulkan_debug_report_callback
(
struct
wine_vk_debug_report_params
*
params
,
ULONG
size
)
{
return
params
->
user_callback
(
params
->
flags
,
params
->
object_type
,
params
->
object_handle
,
params
->
location
,
params
->
code
,
params
->
layer_prefix
,
params
->
message
,
params
->
user_data
);
}
static
BOOL
WINAPI
call_vulkan_debug_utils_callback
(
struct
wine_vk_debug_utils_params
*
params
,
ULONG
size
)
{
return
params
->
user_callback
(
params
->
severity
,
params
->
message_types
,
&
params
->
data
,
params
->
user_data
);
}
BOOL
WINAPI
DllMain
(
HINSTANCE
hinst
,
DWORD
reason
,
void
*
reserved
)
{
void
**
kernel_callback_table
;
TRACE
(
"%p, %u, %p
\n
"
,
hinst
,
reason
,
reserved
);
switch
(
reason
)
...
...
@@ -382,6 +395,10 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
case
DLL_PROCESS_ATTACH
:
hinstance
=
hinst
;
DisableThreadLibraryCalls
(
hinst
);
kernel_callback_table
=
NtCurrentTeb
()
->
Peb
->
KernelCallbackTable
;
kernel_callback_table
[
NtUserCallVulkanDebugReportCallback
]
=
call_vulkan_debug_report_callback
;
kernel_callback_table
[
NtUserCallVulkanDebugUtilsCallback
]
=
call_vulkan_debug_utils_callback
;
break
;
}
return
TRUE
;
...
...
dlls/winevulkan/vulkan.c
View file @
bfc3a286
...
...
@@ -27,8 +27,7 @@
#include "vulkan_private.h"
#include "winreg.h"
#include "winuser.h"
#include "winternl.h"
#include "ntuser.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
vulkan
);
...
...
@@ -115,9 +114,11 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
const
VkDebugUtilsMessengerCallbackDataEXT_host
*
callback_data
,
void
*
user_data
)
{
struct
VkDebugUtilsMessengerCallbackDataEXT
wine_callback_data
;
struct
wine_vk_debug_utils_params
params
;
VkDebugUtilsObjectNameInfoEXT
*
object_name_infos
;
struct
wine_debug_utils_messenger
*
object
;
void
*
ret_ptr
;
ULONG
ret_len
;
VkBool32
result
;
unsigned
int
i
;
...
...
@@ -131,11 +132,16 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
return
VK_FALSE
;
}
wine_callback_data
=
*
((
VkDebugUtilsMessengerCallbackDataEXT
*
)
callback_data
);
/* FIXME: we should pack all referenced structs instead of passing pointers */
params
.
user_callback
=
object
->
user_callback
;
params
.
user_data
=
object
->
user_data
;
params
.
severity
=
severity
;
params
.
message_types
=
message_types
;
params
.
data
=
*
((
VkDebugUtilsMessengerCallbackDataEXT
*
)
callback_data
);
object_name_infos
=
calloc
(
wine_callback_
data
.
objectCount
,
sizeof
(
*
object_name_infos
));
object_name_infos
=
calloc
(
params
.
data
.
objectCount
,
sizeof
(
*
object_name_infos
));
for
(
i
=
0
;
i
<
wine_callback_
data
.
objectCount
;
i
++
)
for
(
i
=
0
;
i
<
params
.
data
.
objectCount
;
i
++
)
{
object_name_infos
[
i
].
sType
=
callback_data
->
pObjects
[
i
].
sType
;
object_name_infos
[
i
].
pNext
=
callback_data
->
pObjects
[
i
].
pNext
;
...
...
@@ -158,10 +164,11 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
}
}
wine_callback_
data
.
pObjects
=
object_name_infos
;
params
.
data
.
pObjects
=
object_name_infos
;
/* applications should always return VK_FALSE */
result
=
object
->
user_callback
(
severity
,
message_types
,
&
wine_callback_data
,
object
->
user_data
);
result
=
KeUserModeCallback
(
NtUserCallVulkanDebugUtilsCallback
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
free
(
object_name_infos
);
...
...
@@ -171,7 +178,10 @@ static VkBool32 debug_utils_callback_conversion(VkDebugUtilsMessageSeverityFlagB
static
VkBool32
debug_report_callback_conversion
(
VkDebugReportFlagsEXT
flags
,
VkDebugReportObjectTypeEXT
object_type
,
uint64_t
object_handle
,
size_t
location
,
int32_t
code
,
const
char
*
layer_prefix
,
const
char
*
message
,
void
*
user_data
)
{
struct
wine_vk_debug_report_params
params
;
struct
wine_debug_report_callback
*
object
;
void
*
ret_ptr
;
ULONG
ret_len
;
TRACE
(
"%#x, %#x, 0x%s, 0x%s, %d, %p, %p, %p
\n
"
,
flags
,
object_type
,
wine_dbgstr_longlong
(
object_handle
),
wine_dbgstr_longlong
(
location
),
code
,
layer_prefix
,
message
,
user_data
);
...
...
@@ -184,12 +194,22 @@ static VkBool32 debug_report_callback_conversion(VkDebugReportFlagsEXT flags, Vk
return
VK_FALSE
;
}
object_handle
=
wine_vk_get_wrapper
(
object
->
instance
,
object_handle
);
if
(
!
object_handle
)
object_type
=
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
;
/* FIXME: we should pack all referenced structs instead of passing pointers */
params
.
user_callback
=
object
->
user_callback
;
params
.
user_data
=
object
->
user_data
;
params
.
flags
=
flags
;
params
.
object_type
=
object_type
;
params
.
location
=
location
;
params
.
code
=
code
;
params
.
layer_prefix
=
layer_prefix
;
params
.
message
=
message
;
return
object
->
user_callback
(
flags
,
object_type
,
object_handle
,
location
,
code
,
layer_prefix
,
message
,
object
->
user_data
);
params
.
object_handle
=
wine_vk_get_wrapper
(
object
->
instance
,
object_handle
);
if
(
!
params
.
object_handle
)
params
.
object_type
=
VK_DEBUG_REPORT_OBJECT_TYPE_UNKNOWN_EXT
;
return
KeUserModeCallback
(
NtUserCallVulkanDebugReportCallback
,
&
params
,
sizeof
(
params
),
&
ret_ptr
,
&
ret_len
);
}
static
void
wine_vk_physical_device_free
(
struct
VkPhysicalDevice_T
*
phys_dev
)
...
...
dlls/winevulkan/vulkan_loader.h
View file @
bfc3a286
...
...
@@ -69,6 +69,32 @@ void *wine_vk_get_device_proc_addr(const char *name) DECLSPEC_HIDDEN;
void
*
wine_vk_get_phys_dev_proc_addr
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
void
*
wine_vk_get_instance_proc_addr
(
const
char
*
name
)
DECLSPEC_HIDDEN
;
/* debug callbacks params */
struct
wine_vk_debug_utils_params
{
PFN_vkDebugUtilsMessengerCallbackEXT
user_callback
;
void
*
user_data
;
VkDebugUtilsMessageSeverityFlagBitsEXT
severity
;
VkDebugUtilsMessageTypeFlagsEXT
message_types
;
VkDebugUtilsMessengerCallbackDataEXT
data
;
};
struct
wine_vk_debug_report_params
{
PFN_vkDebugReportCallbackEXT
user_callback
;
void
*
user_data
;
VkDebugReportFlagsEXT
flags
;
VkDebugReportObjectTypeEXT
object_type
;
uint64_t
object_handle
;
size_t
location
;
int32_t
code
;
const
char
*
layer_prefix
;
const
char
*
message
;
};
extern
const
struct
unix_funcs
*
unix_funcs
;
extern
unixlib_handle_t
unix_handle
DECLSPEC_HIDDEN
;
...
...
include/ntuser.h
View file @
bfc3a286
...
...
@@ -27,6 +27,9 @@
enum
{
NtUserCallEnumDisplayMonitor
,
NtUserCallVulkanDebugReportCallback
,
NtUserCallVulkanDebugUtilsCallback
,
NtUserCallCount
};
/* NtUserCallEnumDisplayMonitor params */
...
...
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