On Thu, 24 Oct 2019 at 16:17, Zhiyi Zhang zzhang@codeweavers.com wrote:
-static void dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) +static HRESULT dxgi_output_init(struct dxgi_output *output, struct dxgi_adapter *adapter) {
- struct wined3d_output_desc wined3d_desc;
- output->IDXGIOutput4_iface.lpVtbl = &dxgi_output_vtbl; output->refcount = 1; wined3d_private_store_init(&output->private_store); output->adapter = adapter; IWineDXGIAdapter_AddRef(&output->adapter->IWineDXGIAdapter_iface);
- wined3d_mutex_lock();
- wined3d_get_output_desc(output->adapter->factory->wined3d, output->adapter->ordinal, &wined3d_desc);
- wined3d_mutex_unlock();
- return wined3d_output_create(wined3d_desc.device_name, &output->wined3d_output);
}
It doesn't seem right for the wined3d output to be created by the dxgi output, it seems like it should be owned by the wined3d_adapter instead. I.e., I think ideally we'd have something like "wined3d_output = wined3d_adapter_get_output(wined3d_adapter, output_idx);", but until adapters and outputs are split on the wined3d level, that would probably have to be something like "wined3d_output = wined3d_get_adapter_output(wined3d, adapter_idx);" instead.
If you're up for it (and since I know you've been doing work in this area), perhaps it makes sense to convert things like "wined3d_get_adapter_display_mode(wined3d, adapter_idx, ...)" to "wined3d_adapter_get_display_mode(wined3d_adapter, ...)" as a first step.