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
19a23b78
Commit
19a23b78
authored
Nov 09, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Support conversion of optional parameters.
parent
2f5c985e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
make_vulkan
dlls/winevulkan/make_vulkan
+14
-2
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+8
-4
No files found.
dlls/winevulkan/make_vulkan
View file @
19a23b78
...
...
@@ -759,6 +759,9 @@ class VkFunction(object):
host_type
=
p
.
type
+
"_host"
if
conv
and
p
.
needs_host_type
()
else
p
.
type
if
p
.
is_dynamic_array
():
body
+=
" {0} *{1}_host;
\n
"
.
format
(
host_type
,
p
.
name
)
elif
p
.
optional
:
body
+=
" {0} *{1}_host = NULL;
\n
"
.
format
(
host_type
,
p
.
name
)
needs_alloc
=
True
else
:
body
+=
" {0} {1}_host;
\n
"
.
format
(
host_type
,
p
.
name
)
if
p
.
needs_alloc
(
conv
,
unwrap
):
...
...
@@ -1558,6 +1561,13 @@ class VkParam(VkVariable):
if
self
.
is_dynamic_array
():
return
" {1}_host = convert_{2}_array_{4}_to_{6}host({5}{0}{1}, {3});
\n
"
.
format
(
prefix
,
self
.
name
,
self
.
type
,
self
.
get_dyn_array_len
(
prefix
),
win_type
,
ctx_param
,
wrap_part
)
elif
self
.
optional
:
ret
=
" if ({0}{1})
\n
"
.
format
(
prefix
,
self
.
name
)
ret
+=
" {
\n
"
ret
+=
" {0}_host = conversion_context_alloc(&ctx, sizeof(*{0}_host));
\n
"
.
format
(
self
.
name
)
ret
+=
" convert_{0}_{3}_to_{5}host({4}{1}{2}, {2}_host);
\n
"
.
format
(
self
.
type
,
prefix
,
self
.
name
,
win_type
,
ctx_param
,
wrap_part
)
ret
+=
" }
\n
"
return
ret
else
:
return
" convert_{0}_{3}_to_{5}host({4}{1}{2}, &{2}_host);
\n
"
.
format
(
self
.
type
,
prefix
,
self
.
name
,
win_type
,
ctx_param
,
wrap_part
)
else
:
...
...
@@ -1565,7 +1575,9 @@ class VkParam(VkVariable):
return
" convert_{0}_array_{1}host_to_{2}({3}_host, {4}{3}, {5});
\n
"
.
format
(
self
.
type
,
wrap_part
,
win_type
,
self
.
name
,
prefix
,
self
.
get_dyn_array_len
(
prefix
))
else
:
return
" convert_{0}_host_to_{3}(&{2}_host, {1}{2});
\n
"
.
format
(
self
.
type
,
prefix
,
self
.
name
,
win_type
)
ref_part
=
""
if
self
.
optional
else
"&"
return
" convert_{0}_host_to_{3}({4}{2}_host, {1}{2});
\n
"
.
format
(
self
.
type
,
prefix
,
self
.
name
,
win_type
,
ref_part
)
def
definition
(
self
,
postfix
=
None
,
is_member
=
False
,
is_thunk
=
False
):
""" Return prototype for the parameter. E.g. 'const char *foo' """
...
...
@@ -1700,7 +1712,7 @@ class VkParam(VkVariable):
return
"NULL"
if
self
.
needs_variable
(
conv
,
unwrap
):
if
self
.
is_dynamic_array
():
if
self
.
is_dynamic_array
()
or
self
.
optional
:
return
"{0}_host"
.
format
(
self
.
name
)
else
:
return
"&{0}_host"
.
format
(
self
.
name
)
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
19a23b78
...
...
@@ -20582,17 +20582,21 @@ static NTSTATUS thunk32_vkGetDeviceFaultInfoEXT(void *args)
{
struct
vkGetDeviceFaultInfoEXT_params
*
params
=
args
;
VkDeviceFaultCountsEXT_host
pFaultCounts_host
;
VkDeviceFaultInfoEXT_host
pFaultInfo_host
;
VkDeviceFaultInfoEXT_host
*
pFaultInfo_host
=
NULL
;
struct
conversion_context
ctx
;
TRACE
(
"%p, %p, %p
\n
"
,
params
->
device
,
params
->
pFaultCounts
,
params
->
pFaultInfo
);
init_conversion_context
(
&
ctx
);
convert_VkDeviceFaultCountsEXT_win32_to_host
(
params
->
pFaultCounts
,
&
pFaultCounts_host
);
convert_VkDeviceFaultInfoEXT_win32_to_host
(
&
ctx
,
params
->
pFaultInfo
,
&
pFaultInfo_host
);
params
->
result
=
wine_device_from_handle
(
params
->
device
)
->
funcs
.
p_vkGetDeviceFaultInfoEXT
(
wine_device_from_handle
(
params
->
device
)
->
device
,
&
pFaultCounts_host
,
&
pFaultInfo_host
);
if
(
params
->
pFaultInfo
)
{
pFaultInfo_host
=
conversion_context_alloc
(
&
ctx
,
sizeof
(
*
pFaultInfo_host
));
convert_VkDeviceFaultInfoEXT_win32_to_host
(
&
ctx
,
params
->
pFaultInfo
,
pFaultInfo_host
);
}
params
->
result
=
wine_device_from_handle
(
params
->
device
)
->
funcs
.
p_vkGetDeviceFaultInfoEXT
(
wine_device_from_handle
(
params
->
device
)
->
device
,
&
pFaultCounts_host
,
pFaultInfo_host
);
convert_VkDeviceFaultCountsEXT_host_to_win32
(
&
pFaultCounts_host
,
params
->
pFaultCounts
);
convert_VkDeviceFaultInfoEXT_host_to_win32
(
&
pFaultInfo_host
,
params
->
pFaultInfo
);
convert_VkDeviceFaultInfoEXT_host_to_win32
(
pFaultInfo_host
,
params
->
pFaultInfo
);
free_conversion_context
(
&
ctx
);
return
STATUS_SUCCESS
;
}
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