https://bugs.winehq.org/show_bug.cgi?id=51360
Bug ID: 51360 Summary: vkGetDeviceProcAddr invalid behavior for functions from extensions unsupported by host Vulkan instance Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: winevulkan Assignee: wine-bugs@winehq.org Reporter: loothelion@nvidia.com Distribution: ---
I believe the below may also be true for vkGetInstanceProcAddr, but I haven't confirmed this locally.
The Vulkan 1.2.182 specification states the following about the behavior of vkGetDeviceProcAddr:
The table below defines the various use cases for vkGetDeviceProcAddr and expected return value for each case.
The returned function pointer is of type PFN_vkVoidFunction, and must be cast to the type of the command being queried before use. The function pointer must only be called with a dispatchable object (the first parameter) that is device or a child of device.
Table 2. vkGetDeviceProcAddr behavior
device | pName | return value
NULL | *[1] | undefined
invalid device | *[1] | undefined
device | NULL | undefined
device | core device-level Vulkan command [2] | fp[3]
device | enabled extension device-level commands [2] | fp[3]
any other case, not covered above | NULL
[1] - "*" means any representable value for the parameter (including valid values, invalid values, and NULL).
[2] - In this function, device-level excludes all physical-device-level commands.
[3] - The returned function pointer must only be called with a dispatchable object (the first parameter) that is device or a child of device e.g. VkDevice, VkQueue, or VkCommandBuffer.
Winevulkan's behavior differs from this slightly. Note the fifth row of the table uses the language "enabled extension device-level commands", this means that if a command is queried via vkGetDeviceProcAddr and isn't part of core, the extension which introduces it must be enabled for the given VkDevice object in order for vkGetDeviceProcAddr to return a valid function pointer, and otherwise it should return NULL.
In order to properly conform to the Vulkan specification Winevulkan should only expose device-level commands whose extensions have been enabled.
Note that applications should not be querying for Vulkan commands via vkGetDeviceProcAddr if they know the extension is not supported by the underlying implementation. However in the case of an application which does rely on this bad behavior, Winevulkan will return a function pointer to one of its thunks and then proceed to deference a null function pointer when it tries to call into the underlying host Vulkan implementation.
https://bugs.winehq.org/show_bug.cgi?id=51360
Henri Verbeet hverbeet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan.riesenberger@gmail.c | |om
--- Comment #1 from Henri Verbeet hverbeet@gmail.com --- *** Bug 51384 has been marked as a duplicate of this bug. ***
https://bugs.winehq.org/show_bug.cgi?id=51360
--- Comment #2 from Stefan Riesenberger stefan.riesenberger@gmail.com --- I can confirm that Rainbow Six Siege Vulkan is fixed after the patches from Georg Lehmann.
https://bugs.winehq.org/show_bug.cgi?id=51360
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Fixed by SHA1| |fc8dcb53c2cebf9a08d9c49a4f7 | |fc021b79fc819 Resolution|--- |FIXED
--- Comment #3 from Gijs Vermeulen gijsvrm@gmail.com --- Assuming fixed by
https://source.winehq.org/git/wine.git/commit/fc8dcb53c2cebf9a08d9c49a4f7fc0...
based on Comment #2. If anyone can still reproduce, feel free to reopen.
https://bugs.winehq.org/show_bug.cgi?id=51360
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |6.11
https://bugs.winehq.org/show_bug.cgi?id=51360
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.2.