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
d8e0c8ad
Commit
d8e0c8ad
authored
Feb 21, 2024
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 29, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Refactor extra extensions handling in wine_vk_device_convert_create_info.
parent
64914849
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
10 deletions
+27
-10
vulkan.c
dlls/winevulkan/vulkan.c
+27
-10
No files found.
dlls/winevulkan/vulkan.c
View file @
d8e0c8ad
...
@@ -391,10 +391,21 @@ static void wine_vk_device_get_queues(struct wine_device *device,
...
@@ -391,10 +391,21 @@ static void wine_vk_device_get_queues(struct wine_device *device,
}
}
}
}
static
const
char
*
find_extension
(
const
char
*
const
*
extensions
,
uint32_t
count
,
const
char
*
ext
)
{
while
(
count
--
)
{
if
(
!
strcmp
(
extensions
[
count
],
ext
))
return
extensions
[
count
];
}
return
NULL
;
}
static
VkResult
wine_vk_device_convert_create_info
(
struct
wine_phys_dev
*
phys_dev
,
static
VkResult
wine_vk_device_convert_create_info
(
struct
wine_phys_dev
*
phys_dev
,
struct
conversion_context
*
ctx
,
const
VkDeviceCreateInfo
*
src
,
VkDeviceCreateInfo
*
dst
)
struct
conversion_context
*
ctx
,
const
VkDeviceCreateInfo
*
src
,
VkDeviceCreateInfo
*
dst
)
{
{
unsigned
int
i
;
const
char
*
extra_extensions
[
2
],
*
const
*
extensions
=
src
->
ppEnabledExtensionNames
;
unsigned
int
i
,
extra_count
=
0
,
extensions_count
=
src
->
enabledExtensionCount
;
*
dst
=
*
src
;
*
dst
=
*
src
;
...
@@ -402,10 +413,10 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de
...
@@ -402,10 +413,10 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de
dst
->
enabledLayerCount
=
0
;
dst
->
enabledLayerCount
=
0
;
dst
->
ppEnabledLayerNames
=
NULL
;
dst
->
ppEnabledLayerNames
=
NULL
;
TRACE
(
"Enabled %u extensions.
\n
"
,
dst
->
enabledExtensionC
ount
);
TRACE
(
"Enabled %u extensions.
\n
"
,
extensions_c
ount
);
for
(
i
=
0
;
i
<
dst
->
enabledExtensionC
ount
;
i
++
)
for
(
i
=
0
;
i
<
extensions_c
ount
;
i
++
)
{
{
const
char
*
extension_name
=
dst
->
ppEnabledExtensionName
s
[
i
];
const
char
*
extension_name
=
extension
s
[
i
];
TRACE
(
"Extension %u: %s.
\n
"
,
i
,
debugstr_a
(
extension_name
));
TRACE
(
"Extension %u: %s.
\n
"
,
i
,
debugstr_a
(
extension_name
));
if
(
!
wine_vk_device_extension_supported
(
extension_name
))
if
(
!
wine_vk_device_extension_supported
(
extension_name
))
{
{
...
@@ -416,14 +427,20 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de
...
@@ -416,14 +427,20 @@ static VkResult wine_vk_device_convert_create_info(struct wine_phys_dev *phys_de
if
(
phys_dev
->
external_memory_align
)
if
(
phys_dev
->
external_memory_align
)
{
{
if
(
!
find_extension
(
extensions
,
extensions_count
,
"VK_KHR_external_memory"
))
extra_extensions
[
extra_count
++
]
=
"VK_KHR_external_memory"
;
if
(
!
find_extension
(
extensions
,
extensions_count
,
"VK_EXT_external_memory_host"
))
extra_extensions
[
extra_count
++
]
=
"VK_EXT_external_memory_host"
;
}
if
(
extra_count
)
{
const
char
**
new_extensions
;
const
char
**
new_extensions
;
new_extensions
=
conversion_context_alloc
(
ctx
,
(
dst
->
enabledExtensionCount
+
2
)
*
dst
->
enabledExtensionCount
+=
extra_count
;
sizeof
(
*
dst
->
ppEnabledExtensionNames
));
new_extensions
=
conversion_context_alloc
(
ctx
,
dst
->
enabledExtensionCount
*
sizeof
(
*
new_extensions
));
memcpy
(
new_extensions
,
src
->
ppEnabledExtensionNames
,
memcpy
(
new_extensions
,
extensions
,
extensions_count
*
sizeof
(
*
new_extensions
));
dst
->
enabledExtensionCount
*
sizeof
(
*
dst
->
ppEnabledExtensionNames
));
memcpy
(
new_extensions
+
extensions_count
,
extra_extensions
,
extra_count
*
sizeof
(
*
new_extensions
));
new_extensions
[
dst
->
enabledExtensionCount
++
]
=
"VK_KHR_external_memory"
;
new_extensions
[
dst
->
enabledExtensionCount
++
]
=
"VK_EXT_external_memory_host"
;
dst
->
ppEnabledExtensionNames
=
new_extensions
;
dst
->
ppEnabledExtensionNames
=
new_extensions
;
}
}
...
...
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