Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
9bf8478c
Commit
9bf8478c
authored
Mar 29, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Mar 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Limit vkGetDeviceProcAddr() workaround to broken apps.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
12bbfe9b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
vulkan.c
dlls/winevulkan/vulkan.c
+14
-5
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+6
-0
No files found.
dlls/winevulkan/vulkan.c
View file @
9bf8478c
...
...
@@ -580,6 +580,8 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev,
}
}
object
->
quirks
=
phys_dev
->
instance
->
quirks
;
*
device
=
object
;
return
VK_SUCCESS
;
}
...
...
@@ -587,8 +589,9 @@ VkResult WINAPI wine_vkCreateDevice(VkPhysicalDevice phys_dev,
VkResult
WINAPI
wine_vkCreateInstance
(
const
VkInstanceCreateInfo
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkInstance
*
instance
)
{
struct
VkInstance_T
*
object
=
NULL
;
VkInstanceCreateInfo
create_info_host
;
const
VkApplicationInfo
*
app_info
;
struct
VkInstance_T
*
object
;
VkResult
res
;
TRACE
(
"create_info %p, allocator %p, instance %p
\n
"
,
create_info
,
allocator
,
instance
);
...
...
@@ -635,6 +638,13 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
return
res
;
}
if
((
app_info
=
create_info
->
pApplicationInfo
)
&&
app_info
->
pApplicationName
)
{
if
(
!
strcmp
(
app_info
->
pApplicationName
,
"DOOM"
)
||
!
strcmp
(
app_info
->
pApplicationName
,
"Wolfenstein II The New Colossus"
))
object
->
quirks
|=
WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR
;
}
*
instance
=
object
;
TRACE
(
"Done, instance=%p native_instance=%p
\n
"
,
object
,
object
->
instance
);
return
VK_SUCCESS
;
...
...
@@ -808,13 +818,12 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char *
* subdevice objects. The games don't actually use the function pointers and if they
* did, they would crash as VkInstance / VkPhysicalDevice parameters need unwrapping.
* Khronos clarified behavior in the Vulkan spec and expects drivers to get updated,
* however it would require both driver and game fixes. Since it are major titles
* it is not clear what will happen. At least for now we need the hack below.
* however it would require both driver and game fixes.
* https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2323
* https://github.com/KhronosGroup/Vulkan-Docs/issues/655
*/
func
=
wine_vk_get_instance_proc_addr
(
name
);
if
(
func
)
if
(
device
->
quirks
&
WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR
&&
(
func
=
wine_vk_get_instance_proc_addr
(
name
))
)
{
WARN
(
"Returning instance function %s.
\n
"
,
debugstr_a
(
name
));
return
func
;
...
...
dlls/winevulkan/vulkan_private.h
View file @
9bf8478c
...
...
@@ -34,6 +34,8 @@
#define ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
#endif
#define WINEVULKAN_QUIRK_GET_DEVICE_PROC_ADDR 0x00000001
struct
vulkan_func
{
const
char
*
name
;
...
...
@@ -70,6 +72,8 @@ struct VkDevice_T
struct
VkQueue_T
**
queues
;
VkDevice
device
;
/* native device */
unsigned
int
quirks
;
};
struct
VkInstance_T
...
...
@@ -84,6 +88,8 @@ struct VkInstance_T
struct
VkPhysicalDevice_T
**
phys_devs
;
VkInstance
instance
;
/* native instance */
unsigned
int
quirks
;
};
struct
VkPhysicalDevice_T
...
...
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