[PATCH 2/2] winevulkan: Unwrap VkSurfaceKHR if required.

Georg Lehmann dadschoorse at gmail.com
Thu Jan 21 13:58:37 CST 2021


On 21.01.21 19:36, Liam Middlebrook wrote:
> 
> 
> On 1/21/21 10:12 AM, Georg Lehmann wrote:
>> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50422
>>
>> Signed-off-by: Georg Lehmann <dadschoorse at gmail.com>
>> ---
>>   dlls/winevulkan/make_vulkan | 9 ++++++++-
>>   1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan
>> index 9fa0b2c9507..d2fc5b28114 100755
>> --- a/dlls/winevulkan/make_vulkan
>> +++ b/dlls/winevulkan/make_vulkan
>> @@ -955,6 +955,8 @@ class VkHandle(object):
>>               return 
>> "wine_debug_utils_messenger_from_handle({0})->debug_messenger".format(name) 
>>
>>           if self.name == "VkDebugReportCallbackEXT":
>>               return 
>> "wine_debug_report_callback_from_handle({0})->debug_callback".format(name) 
>>
>> +        if self.name == "VkSurfaceKHR":
>> +            return 
>> "wine_surface_from_handle({0})->base.surface".format(name)
>>           native_handle_name = None
>> @@ -979,6 +981,8 @@ class VkHandle(object):
>>       def is_wrapped(self):
>>           return self.native_handle("test") is not None
>> +    def is_wsi_wrapper(self):
>> +        return self.name == "VkSurfaceKHR"
>>   class VkMember(object):
>>       def __init__(self, const=False, 
>> struct_fwd_decl=False,_type=None, pointer=None, name=None, 
>> array_len=None,
>> @@ -1602,7 +1606,10 @@ class VkParam(object):
>>                   return "&{0}_host".format(self.name)
>>           else:
>>               # We need to pass the native handle to the native Vulkan 
>> calls.
>> -            native_handle = self.handle.native_handle(self.name) if 
>> self.is_handle() else None
>> +            if self.is_handle() and not self.handle.is_wsi_wrapper():
>> +                native_handle = self.handle.native_handle(self.name)
>> +            else:
>> +                native_handle = None
> 
> Can you explain why this is needed?

It's needed because otherwise winevulkan would pass the native surface 
handle to winex11/winemac but those use the wrapped handle to get their 
data + pass the native surface to the linux side. I will add a comment.

Thanks,

Georg Lehmann

> 
> 
> Thanks,
> 
> Liam Middlebrook
> 
>>               return native_handle if native_handle else self.name
>>
> 




More information about the wine-devel mailing list