[PATCH 2/3] winevulkan: Implement extension faking mechanism

Joshua Ashton joshua at froggi.es
Tue Oct 13 19:10:58 CDT 2020


To add on about the layer thing, not removing random unsupported pNext 
elements has and will break layers like RenderDoc and OBS and 
potentially drivers down the line.

The typical pattern I see is
if (info->pNext->sType == VK_STRUCTURE_TYPE_MY_UNSUPPORTED_STRUCTURE_FROG)
{
#ifdef _WIN32
	// Handle whatever this is...
	info->pNext->...
#else
	// Uh oh! Something went wrong here...
	abort(1);
#endif
}

The problem here is that the structure type is still defined in 
vulkan_core.h despite the structs, etc being defined in vulkan_win32.h 
which causes this pattern.

Many Layers (and potentially drivers) do stuff this, and not filtering 
out the pNexts will break them.
- Joshie 🐸✨

On 10/14/20 1:02 AM, Joshua Ashton wrote:
> Zeb, it's in vulkan_win32.h.
> You can't include it on Linux or any other platform for that matter.
> If you read the xml, it's marked as being `platform="win32"`.
> It's a Windows extension.
> 
> To move it out of there on a Vulkan level, we'd need to make a sequel 
> and different platform-specific extensions.
> Inherently making this version unsupportable in non-Windows drivers.
> 
> It makes more sense to read the line of VK_KHR_win32_surface support 
> more as if you want surfaces (ie. not headless) than focusing on the 
> platform part of things.
> 
> - Joshie 🐸✨
> 
> On 10/14/20 12:37 AM, Georg Lehmann wrote:
>> On 14.10.20 01:23, Zebediah Figura wrote:
>>> On 10/13/20 4:54 PM, Joshua Ashton wrote:
>>>> Figured I should add the reason why, is because just passing it through
>>>> will cause the device to fail to be created because nobody supports
>>>> VK_EXT_full_screen_exclusive on Linux.
>>> Sure, but they could.
>>>
>>>> It's an entirely Windows-centric extension.
>>> Well, no, it's not really, but it does include some API-level
>>> integration with win32 monitors *if* KHR_win32_surface is supported. In
>>> that case, as far as I can see, we don't even need to do anything,
>>> because the VkSurfaceFullScreenExclusiveWin32InfoEXT structure would
>>> just be ignored.
>>
>>
>> No, according to the vulkan spec a 
>> VkSurfaceFullScreenExclusiveWin32InfoEXT is illegal in any chain 
>> unless the full screen + win32 surface exts are enabled. In practice, 
>> this will break layers like renderdoc. So we would still need code to 
>> remove that struct from pNext chains.
>>
>>
>> Georg
>>
>>
>>> Not that this necessarily means that lower-level drivers should be the
>>> ones to implement the extension, but if nothing else, this information
>>> isn't present at all in the patch.
>>>
>>> Also, do we really need a generic mechanism for this, wired into
>>> make_vulkan? Can't we just handle this extension specially in
>>> wine_vk_device_convert_create_info()?
>>>
>>>> - Joshie 🐸✨
>>>>
>>>> On 10/13/20 10:42 PM, Joshua Ashton wrote:
>>>>> winex11/winemac only does this for instance extensions.
>>>>>
>>>>> VK_EXT_full_screen_exclusive is a device extension.
>>>>>
>>>>> - Joshie 🐸✨
>>>>>
>>>>> On 10/13/20 10:35 PM, Zebediah Figura wrote:
>>>>>> Why not do this the normal way, i.e. by modifying the code in winex11
>>>>>> and winemac?
>>>>>>
>>>>>> Also, what's the point of faking the extension like this? Why not 
>>>>>> just
>>>>>> pass it through?
>>>>>>
>>>
>>



More information about the wine-devel mailing list