[PATCH 3/3] wined3d: Get adapter LUID from Vulkan if it is available.

Henri Verbeet hverbeet at gmail.com
Mon Jul 6 06:43:07 CDT 2020

On Mon, 6 Jul 2020 at 13:06, Zhiyi Zhang <zzhang at codeweavers.com> wrote:
> @@ -2965,6 +2965,10 @@ static BOOL wined3d_adapter_init_luid(struct wined3d_adapter *adapter)
>      D3DKMT_CLOSEADAPTER close_adapter_param;
> +    /* Already initialised */
> +    if (adapter->luid.LowPart || adapter->luid.HighPart)
> +        return TRUE;
> +
This seems somewhat fragile. The assumption in most *_init() functions
is that the structure it's operating on is zero-initialised, or in
rare cases uninitialised. If wined3d_adapter_init() needs to use a
LUID retrieved by its caller, it seems best to explicitly pass it as a
function argument. (Or NULL if we don't have one.) In principle
another option may be to not initialise the LUID in
wined3d_adapter_init() at all, and just call
wined3d_adapter_init_luid() from its callers, but I imagine that won't
work for assigning outputs.

Similar concerns apply to calling e.g. adapter_vk_init_driver_info()
before wined3d_adapter_init() in patch 2/3.

More information about the wine-devel mailing list