Okay, so I've given this a lot more thought. Thank you for the patience, and I apologize for not having a concrete answer earlier. Here are my current thoughts, and I do invite Henri to push back if he feels otherwise: * I originally thought that "video support" is something we already implement, specifically H.264 video decode. After rereading the documentation I'm less convinced; the lede is that it requires the "WDDM for Windows 8", which, considering that DXVA in a very similar form predates Windows 8, probably has more to do with resource sharing than with hardware video support. Given that I think it would actually be reasonable to just always fail creation with that flag... * ...except that I do have an application here that requires D3D11_CREATE_DEVICE_VIDEO_SUPPORT, and only uses hardware decode and no resource sharing. Making that change would break that application, so having a registry toggle would be warranted. * While I think that implementing proper resource sharing support wouldn't be too hard, it's only going to be able to work with the Vulkan backend, and while I'm working as hard as I can here, we're still a ways away from the Vulkan backend being at parity. So having a workaround until we're there makes sense. Granted, "use Damavand" itself could be the workaround... * As Stian pointed out, there is quite a long list of applications that this would fix. So even though it's not technically a regression (right?) the impact is large enough that I think it's worth having. * However, I would like it to be limited to D3D11_CREATE_DEVICE_VIDEO_SUPPORT. I want to be able to remove this workaround eventually, and that's easier when the scope is limited. With that in mind, some line-by-line review: ``` - dxgi_adapter->wined3d_adapter, WINED3D_DEVICE_TYPE_HAL, NULL, 0, 4, + dxgi_adapter->wined3d_adapter, WINED3D_DEVICE_TYPE_HAL, NULL, flags, 4, ``` These flags already have a meaning which conflicts with the d3d11 flags. See WINED3DCREATE_*. You will probably want to define your own WINED3DCREATE flags and explicitly translate to them. Simply handling D3D11_CREATE_DEVICE_VIDEO_SUPPORT is enough for now. ``` +unsigned int CDECL wined3d_device_create_flags_forced_unsupported(void) +{ + return wined3d_settings.no_create_flags; +} ``` You don't need this function; it can be inlined in its only user. ``` + /* Support forcing unsupported d3d device creation flags to allow + * UnityPlayer.dll to fallback to software video decoding until support for + * resource sharing needed otherwise for D3D11_CREATE_DEVICE_VIDEO_SUPPORT: + * https://bugs.winehq.org/buglist.cgi?quicksearch=%2211398%22 */ ``` This isn't quite grammatical, and we generally don't use Bugzilla links in code. If we want a comment I would write something like "Unity uses shared resources if D3D11_CREATE_DEVICE_VIDEO_SUPPORT succeeds, so allow failing for now." ``` + .no_create_flags = 0, ``` You don't need this; unspecified fields are zero-initialized. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11398#note_147775