[PATCH v3 0/6] MR11720: wined3d: Various.
-- v3: wined3d: Allow disabling video decoding support. dxgi: Implement D3D11_CREATE_DEVICE_VIDEO_SUPPORT. https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
From: Elizabeth Figura <zfigura@codeweavers.com> Not the instance functions. All of the callers expect the former. Mostly this doesn't matter in Wine, but some fully emulated functions, like vkGetMemoryWin32HandleKHR(), are now only exposed as device functions. --- dlls/wined3d/context_vk.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dlls/wined3d/context_vk.c b/dlls/wined3d/context_vk.c index 634390c80ba..7807c1672db 100644 --- a/dlls/wined3d/context_vk.c +++ b/dlls/wined3d/context_vk.c @@ -4399,7 +4399,6 @@ static VkCommandPool create_command_pool(struct wined3d_device_vk *device_vk, HRESULT wined3d_context_vk_init(struct wined3d_context_vk *context_vk, struct wined3d_swapchain *swapchain) { const struct wined3d_vk_info *vk_info; - struct wined3d_adapter_vk *adapter_vk; struct wined3d_device_vk *device_vk; TRACE("context_vk %p, swapchain %p.\n", context_vk, swapchain); @@ -4407,8 +4406,7 @@ HRESULT wined3d_context_vk_init(struct wined3d_context_vk *context_vk, struct wi memset(context_vk, 0, sizeof(*context_vk)); wined3d_context_init(&context_vk->c, swapchain); device_vk = wined3d_device_vk(swapchain->device); - adapter_vk = wined3d_adapter_vk(device_vk->d.adapter); - context_vk->vk_info = vk_info = &adapter_vk->vk_info; + context_vk->vk_info = vk_info = &device_vk->vk_info; if (!(context_vk->vk_command_pool = create_command_pool(device_vk, vk_info, device_vk->graphics_queue.vk_queue_family_index))) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
From: Elizabeth Figura <zfigura@codeweavers.com> Fix a misreading of the code in b10b7e61b58c5536a01e5438607f8fa12a1f7932. --- dlls/d3d9/texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c index 664f91cfb0e..8616dfb1d32 100644 --- a/dlls/d3d9/texture.c +++ b/dlls/d3d9/texture.c @@ -1325,8 +1325,7 @@ static HRESULT d3d9_texture_init(struct d3d9_texture *texture, struct d3d9_devic managed_desc.access = WINED3D_RESOURCE_ACCESS_GPU; managed_desc.bind_flags = desc->bind_flags; - managed_desc.usage &= ~WINED3DUSAGE_GENERATE_MIPMAPS; - if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &managed_desc, layer_count, level_count, flags, + if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &managed_desc, layer_count, level_count, 0, NULL, texture, &d3d9_texture_wined3d_parent_ops, &texture->draw_texture))) { wined3d_texture_decref(texture->wined3d_texture); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
From: Paul Gofman <pgofman@codeweavers.com> --- dlls/d3d11/tests/d3d11.c | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 6ce8745fd05..782b50f8507 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -37587,6 +37587,94 @@ static void test_filter_minmax(void) release_test_context(&test_context); } +static void test_video_support(void) +{ + ID3D11VideoDevice *video_device; + IDXGIFactory4 *factory4; + IDXGIAdapter *adapter; + IDXGIFactory *factory; + ID3D11Device *device; + unsigned int count; + HRESULT hr; + + static const D3D_DRIVER_TYPE driver_types[] = + { + D3D_DRIVER_TYPE_UNKNOWN, + D3D_DRIVER_TYPE_HARDWARE, + D3D_DRIVER_TYPE_REFERENCE, + D3D_DRIVER_TYPE_NULL, + D3D_DRIVER_TYPE_SOFTWARE, + D3D_DRIVER_TYPE_WARP + }; + + if (FAILED(hr = CreateDXGIFactory1(&IID_IDXGIFactory, (void **)&factory))) + { + trace("Failed to create IDXGIFactory, hr %#lx.\n", hr); + return; + } + + for (unsigned int i = 0; i < ARRAY_SIZE(driver_types); ++i) + { + winetest_push_context("driver_type %d", driver_types[i]); + + /* WARP fails video support if created directly, but still allows it + * when created with a NULL adapter. */ + hr = D3D11CreateDevice(NULL, driver_types[i], NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL); + if (driver_types[i] == D3D_DRIVER_TYPE_HARDWARE) + ok(hr == S_OK, "Got %#lx.\n", hr); + else if (driver_types[i] == D3D_DRIVER_TYPE_UNKNOWN || driver_types[i] == D3D_DRIVER_TYPE_SOFTWARE) + todo_wine ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); + else + todo_wine ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); + if (hr == S_OK) + ID3D11Device_Release(device); + + for (unsigned int j = 0; IDXGIFactory_EnumAdapters(factory, j, &adapter) == S_OK; ++j) + { + winetest_push_context("adapter %u", j); + + hr = D3D11CreateDevice(adapter, driver_types[i], NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL); + if (driver_types[i] == D3D_DRIVER_TYPE_UNKNOWN) + ok(hr == S_OK || hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); + else + todo_wine ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); + if (hr == S_OK) + { + hr = ID3D11Device_QueryInterface(device, &IID_ID3D11VideoDevice, (void **)&video_device); + ok(hr == S_OK, "Got %#lx.\n", hr); + + count = ID3D11VideoDevice_GetVideoDecoderProfileCount(video_device); + todo_wine ok(count > 0, "Got no decoder profiles.\n"); + + ID3D11Device_Release(device); + } + + IDXGIAdapter_Release(adapter); + winetest_pop_context(); + } + + if (SUCCEEDED(hr = IDXGIFactory_QueryInterface(factory, &IID_IDXGIFactory4, (void **)&factory4))) + { + hr = IDXGIFactory4_EnumWarpAdapter(factory4, &IID_IDXGIAdapter, (void **)&adapter); + ok(hr == S_OK, "Got %#lx.\n", hr); + + hr = D3D11CreateDevice(adapter, driver_types[i], NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL); + if (driver_types[i] == D3D_DRIVER_TYPE_UNKNOWN) + todo_wine ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); + else + todo_wine ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); + if (hr == S_OK) + ID3D11Device_Release(device); + + IDXGIAdapter_Release(adapter); + } + + winetest_pop_context(); + } + + IDXGIFactory_Release(factory); +} + START_TEST(d3d11) { unsigned int argc, i; @@ -37795,6 +37883,7 @@ START_TEST(d3d11) queue_test(test_nv12); queue_test(test_h264_decoder); queue_test(test_filter_minmax); + queue_test(test_video_support); run_queued_tests(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
From: Elizabeth Figura <zfigura@codeweavers.com> --- dlls/d3d11/device.c | 13 +++++++++++-- dlls/wined3d/device.c | 27 --------------------------- dlls/wined3d/directx.c | 27 +++++++++++++++++++++++++++ dlls/wined3d/wined3d.spec | 4 ++-- include/wine/wined3d.h | 4 ++-- 5 files changed, 42 insertions(+), 33 deletions(-) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index e1a846698e6..6a201ba4582 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -66,6 +66,15 @@ static D3D_FEATURE_LEVEL d3d_feature_level_from_wined3d(enum wined3d_feature_lev return (D3D_FEATURE_LEVEL)level; } +static struct wined3d_adapter *d3d_device_get_adapter(struct d3d_device *device) +{ + struct wined3d *wined3d = wined3d_device_get_wined3d(device->wined3d_device); + struct wined3d_device_creation_parameters params; + + wined3d_device_get_creation_parameters(device->wined3d_device, ¶ms); + return wined3d_get_adapter(wined3d, params.adapter_idx); +} + /* ID3DDeviceContextState methods */ static inline struct d3d_device_context_state *impl_from_ID3DDeviceContextState(ID3DDeviceContextState *iface) @@ -7833,7 +7842,7 @@ static UINT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderProfileCount(ID3 TRACE("iface %p.\n", iface); - return wined3d_device_get_video_decode_profile_count(device->wined3d_device); + return wined3d_adapter_get_decode_profile_count(d3d_device_get_adapter(device)); } static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderProfile( @@ -7843,7 +7852,7 @@ static HRESULT STDMETHODCALLTYPE d3d11_video_device_GetVideoDecoderProfile( TRACE("iface %p, index %u, profile %p.\n", iface, index, profile); - return wined3d_device_get_video_decode_profile(device->wined3d_device, index, profile); + return wined3d_adapter_get_decode_profile(d3d_device_get_adapter(device), index, profile); } static HRESULT STDMETHODCALLTYPE d3d11_video_device_CheckVideoDecoderFormat( diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 7d03601c555..4cabc44b2a6 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -5659,30 +5659,3 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL else return CallWindowProcA(proc, window, message, wparam, lparam); } - -unsigned int CDECL wined3d_device_get_video_decode_profile_count(struct wined3d_device *device) -{ - GUID profiles[WINED3D_DECODER_MAX_PROFILE_COUNT]; - unsigned int count; - - TRACE("device %p.\n", device); - - device->adapter->decoder_ops->get_profiles(device->adapter, &count, profiles); - return count; -} - -HRESULT CDECL wined3d_device_get_video_decode_profile(struct wined3d_device *device, unsigned int idx, GUID *profile) -{ - GUID profiles[WINED3D_DECODER_MAX_PROFILE_COUNT]; - unsigned int count; - - TRACE("device %p, idx %u.\n", device, idx); - - device->adapter->decoder_ops->get_profiles(device->adapter, &count, profiles); - - if (idx >= count) - return E_INVALIDARG; - - *profile = profiles[idx]; - return S_OK; -} diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index e75c3cf625e..91f3e7ae6ea 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -1817,6 +1817,33 @@ HRESULT CDECL wined3d_adapter_get_identifier(const struct wined3d_adapter *adapt return WINED3D_OK; } +unsigned int CDECL wined3d_adapter_get_decode_profile_count(struct wined3d_adapter *adapter) +{ + GUID profiles[WINED3D_DECODER_MAX_PROFILE_COUNT]; + unsigned int count; + + TRACE("adapter %p.\n", adapter); + + adapter->decoder_ops->get_profiles(adapter, &count, profiles); + return count; +} + +HRESULT CDECL wined3d_adapter_get_decode_profile(struct wined3d_adapter *adapter, unsigned int idx, GUID *profile) +{ + GUID profiles[WINED3D_DECODER_MAX_PROFILE_COUNT]; + unsigned int count; + + TRACE("adapter %p, idx %u.\n", adapter, idx); + + adapter->decoder_ops->get_profiles(adapter, &count, profiles); + + if (idx >= count) + return E_INVALIDARG; + + *profile = profiles[idx]; + return S_OK; +} + HRESULT CDECL wined3d_output_get_raster_status(const struct wined3d_output *output, struct wined3d_raster_status *raster_status) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index da7db0c2184..2a3f330ca10 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -19,6 +19,8 @@ @ cdecl wined3d_restore_display_modes(ptr) @ cdecl wined3d_unregister_windows(ptr) +@ cdecl wined3d_adapter_get_decode_profile_count(ptr) +@ cdecl wined3d_adapter_get_decode_profile(ptr long ptr) @ cdecl wined3d_adapter_get_identifier(ptr long ptr) @ cdecl wined3d_adapter_get_output(ptr long) @ cdecl wined3d_adapter_get_output_count(ptr) @@ -83,8 +85,6 @@ @ cdecl wined3d_device_get_state(ptr) @ cdecl wined3d_device_get_swapchain(ptr long) @ cdecl wined3d_device_get_swapchain_count(ptr) -@ cdecl wined3d_device_get_video_decode_profile_count(ptr) -@ cdecl wined3d_device_get_video_decode_profile(ptr long ptr) @ cdecl wined3d_device_get_wined3d(ptr) @ cdecl wined3d_device_incref(ptr) @ cdecl wined3d_device_process_vertices(ptr ptr long long long ptr ptr long long) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 217393d6e29..2dfaf7af7ea 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2372,6 +2372,8 @@ BOOL __cdecl wined3d_register_window(struct wined3d *wined3d, HWND window, HRESULT __cdecl wined3d_restore_display_modes(struct wined3d *wined3d); void __cdecl wined3d_unregister_windows(struct wined3d *wined3d); +unsigned int __cdecl wined3d_adapter_get_decode_profile_count(struct wined3d_adapter *adapter); +HRESULT __cdecl wined3d_adapter_get_decode_profile(struct wined3d_adapter *adapter, unsigned int idx, GUID *profile); HRESULT __cdecl wined3d_adapter_get_identifier(const struct wined3d_adapter *adapter, uint32_t flags, struct wined3d_adapter_identifier *identifier); struct wined3d_output * __cdecl wined3d_adapter_get_output(const struct wined3d_adapter *adapter, @@ -2460,8 +2462,6 @@ struct wined3d_state * __cdecl wined3d_device_get_state(struct wined3d_device *d struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx); UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device); -unsigned int __cdecl wined3d_device_get_video_decode_profile_count(struct wined3d_device *device); -HRESULT __cdecl wined3d_device_get_video_decode_profile(struct wined3d_device *device, unsigned int idx, GUID *profile); struct wined3d * __cdecl wined3d_device_get_wined3d(const struct wined3d_device *device); ULONG __cdecl wined3d_device_incref(struct wined3d_device *device); HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device, struct wined3d_stateblock *stateblock, -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
From: Stian Low <wineryyyyy@gmail.com> This is a somewhat risky change. As described in the patch, many applications are known to use this flag despite not actually requiring video support. Coincidentally, all known such applications are Media Foundation users which also happen to require shared resources, which are not yet implemented, and so already do not work. However, shared resources are not actually necessary to use Media Foundation, nor are they used internally by Media Foundation, and it is still quite possible that applications exist which require this flag and currently work. To make matters worse, while the existence of some degree of hardware video support can reasonably be assumed by anyone using a real GPU these days, the same cannot quite be said of Wine. Vulkan video support is relatively young, and not actually enabled by default on all major drivers; whereas VA support is an optional dependency which is far less ubiquitously installed. Additionally, problems related to patents mean that hardware decode support may not actually be available in Free Software distributions even if the hardware and drivers support them. Hence, even if we were to implement shared resources, this change could potentially prevent games from working. Still, this appears to be a correct change, and the way it's implemented here should cause no known regressions. All of the above concerns are only hypothetical at the moment. By a happy coincidence, allowing device creation to fail here also causes the Unity3D video player, which currently fails due to missing shared resource support, to use a fallback path. This fixes many Unity3D games, including Haven, Ashes of the Sun, and The Room 4. --- dlls/d3d11/d3d11_main.c | 5 +++++ dlls/d3d11/tests/d3d11.c | 7 ++++--- dlls/dxgi/device.c | 28 +++++++++++++++++++++++++++- dlls/dxgi/dxgi_main.c | 4 ++-- dlls/dxgi/dxgi_private.h | 3 ++- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/dlls/d3d11/d3d11_main.c b/dlls/d3d11/d3d11_main.c index 75986318693..e0e5c04546a 100644 --- a/dlls/d3d11/d3d11_main.c +++ b/dlls/d3d11/d3d11_main.c @@ -183,6 +183,11 @@ static HRESULT d3d11_create_device(IDXGIAdapter *adapter, D3D_DRIVER_TYPE driver } else { + /* Windows allows device creation to succeed in this case even if the + * chosen device lacks video support. See also dxgi_device_init(). */ + if (driver_type == D3D_DRIVER_TYPE_HARDWARE) + flags &= ~D3D11_CREATE_DEVICE_VIDEO_SUPPORT; + hr = CreateDXGIFactory1(&IID_IDXGIFactory, (void **)&factory); if (FAILED(hr)) { diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 782b50f8507..ce745d35ef2 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -37625,7 +37625,8 @@ static void test_video_support(void) else if (driver_types[i] == D3D_DRIVER_TYPE_UNKNOWN || driver_types[i] == D3D_DRIVER_TYPE_SOFTWARE) todo_wine ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); else - todo_wine ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); + todo_wine_if(driver_types[i] != D3D_DRIVER_TYPE_WARP || damavand) + ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); if (hr == S_OK) ID3D11Device_Release(device); @@ -37644,7 +37645,7 @@ static void test_video_support(void) ok(hr == S_OK, "Got %#lx.\n", hr); count = ID3D11VideoDevice_GetVideoDecoderProfileCount(video_device); - todo_wine ok(count > 0, "Got no decoder profiles.\n"); + ok(count > 0, "Got no decoder profiles.\n"); ID3D11Device_Release(device); } @@ -37660,7 +37661,7 @@ static void test_video_support(void) hr = D3D11CreateDevice(adapter, driver_types[i], NULL, D3D11_CREATE_DEVICE_VIDEO_SUPPORT, NULL, 0, D3D11_SDK_VERSION, &device, NULL, NULL); if (driver_types[i] == D3D_DRIVER_TYPE_UNKNOWN) - todo_wine ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); + todo_wine_if(damavand) ok(hr == DXGI_ERROR_UNSUPPORTED, "Got %#lx.\n", hr); else todo_wine ok(hr == E_INVALIDARG, "Got %#lx.\n", hr); if (hr == S_OK) diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index eedcc81d845..0d95fe4b645 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -485,7 +485,7 @@ static const struct IWineDXGISwapChainFactoryVtbl dxgi_swapchain_factory_vtbl = }; HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer, - IDXGIFactory *factory, IDXGIAdapter *adapter, + IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count) { struct wined3d_device_parent *wined3d_device_parent; @@ -511,6 +511,32 @@ HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *l return E_FAIL; } + /* Unlike other flags, this flag does not change device behaviour, but + * instead causes creation to fail if "video support" is not available. + * + * The name implies this means d3d11 video decode support. The documentation + * is less clear, and states that the display driver must support WDDM 1.2. + * WDDM 1.2 seems to include d3d11 video support, among other things. + * + * What muddies the issue is that it's not clear that WDDM 1.2 requires that + * the device is capable of actually decoding any specific codec. In + * practice, probably the only WDDM 1.2 driver which doesn't support any + * video codecs is WARP, which, confusingly, fails when D3D11CreateDevice() + * is called with the WARP adapter, but succeeds when called with a NULL + * adapter (assuming of course no hardware display driver is available.) + * Also, Media Foundation documents that this flag must be used on devices + * used with IMFDXGIDeviceManager, but Media Foundation as a whole does not + * depend on hardware decoding or video processing. + * + * Known applications using this flag seem to either directly use decode + * APIs, or IMFDXGIDeviceManager. */ + if ((flags & D3D11_CREATE_DEVICE_VIDEO_SUPPORT) + && !wined3d_adapter_get_decode_profile_count(dxgi_adapter->wined3d_adapter)) + { + WARN("Device does not support video decode; returning DXGI_ERROR_UNSUPPORTED.\n"); + return DXGI_ERROR_UNSUPPORTED; + } + device->IWineDXGIDevice_iface.lpVtbl = &dxgi_device_vtbl; device->IWineDXGISwapChainFactory_iface.lpVtbl = &dxgi_swapchain_factory_vtbl; device->refcount = 1; diff --git a/dlls/dxgi/dxgi_main.c b/dlls/dxgi/dxgi_main.c index ca1fb525535..0e2c23806ba 100644 --- a/dlls/dxgi/dxgi_main.c +++ b/dlls/dxgi/dxgi_main.c @@ -145,7 +145,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I TRACE("d3d10core %p, factory %p, adapter %p, flags %#x, feature_levels %p, level_count %u, device %p.\n", d3d10core, factory, adapter, flags, feature_levels, level_count, device); - if (flags) + if (flags & ~D3D11_CREATE_DEVICE_VIDEO_SUPPORT) FIXME("Ignoring flags %#x.\n", flags); if (TRACE_ON(dxgi)) @@ -191,7 +191,7 @@ HRESULT WINAPI DXGID3D10CreateDevice(HMODULE d3d10core, IDXGIFactory *factory, I return E_OUTOFMEMORY; } - hr = dxgi_device_init(dxgi_device, &d3d10_layer, factory, adapter, feature_levels, level_count); + hr = dxgi_device_init(dxgi_device, &d3d10_layer, factory, adapter, flags, feature_levels, level_count); if (FAILED(hr)) { WARN("Failed to initialize device, hr %#lx.\n", hr); diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index ed82d366799..6ecd5751243 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -32,6 +32,7 @@ #include "dxgi1_6.h" #include "d3d10_1.h" +#include "d3d11.h" #include "d3d12.h" #ifdef DXGI_INIT_GUID #include "initguid.h" @@ -138,7 +139,7 @@ struct dxgi_device }; HRESULT dxgi_device_init(struct dxgi_device *device, struct dxgi_device_layer *layer, - IDXGIFactory *factory, IDXGIAdapter *adapter, + IDXGIFactory *factory, IDXGIAdapter *adapter, unsigned int flags, const D3D_FEATURE_LEVEL *feature_levels, unsigned int level_count); /* IDXGIOutput */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
On Thu Aug 20 22:58:25 2026 +0000, Elizabeth Figura wrote:
changed this line in [version 3 of the diff](/wine/wine/-/merge_requests/11720/diffs?diff_id=292215&start_sha=01dfb956a4d87df510c13d7530496fe3c952bfd0#20699ad94dd0a7d3190c0e379420185a3a44be43_37720_37720) Thanks for catching that; fixed now.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11720#note_149485
From: Elizabeth Figura <zfigura@codeweavers.com> For testing purposes. --- dlls/wined3d/adapter_vk.c | 4 +++- dlls/wined3d/wined3d_main.c | 5 +++++ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 3e349247899..b761f4c4753 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -2615,7 +2615,9 @@ static BOOL wined3d_adapter_vk_init(struct wined3d_adapter_vk *adapter_vk, adapter->misc_state_template = misc_state_template_vk; adapter->shader_backend = wined3d_spirv_shader_backend_init_vk(); - if (wined3d_settings.decoder_backend == WINED3D_DECODER_BACKEND_VA + if (wined3d_settings.decoder_backend == WINED3D_DECODER_BACKEND_NONE) + adapter->decoder_ops = &wined3d_null_decoder_ops; + else if (wined3d_settings.decoder_backend == WINED3D_DECODER_BACKEND_VA || (wined3d_settings.decoder_backend == WINED3D_DECODER_BACKEND_AUTO && !vk_info->supported[WINED3D_VK_KHR_VIDEO_DECODE_H264])) adapter->decoder_ops = &wined3d_decoder_va_vk_ops; diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index 976ea72d69c..426b959c7d0 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -376,6 +376,11 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) ERR_(winediag)("Using the VA video decoder backend.\n"); wined3d_settings.decoder_backend = WINED3D_DECODER_BACKEND_VA; } + else if (!stricmp(buffer, "none")) + { + ERR_(winediag)("Disabling hardware video decoding support.\n"); + wined3d_settings.decoder_backend = WINED3D_DECODER_BACKEND_NONE; + } } if (!get_config_key_dword(hkey, appkey, env, "VideoPciDeviceID", &tmpvalue)) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index cb1ca037272..30a442d81ed 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -462,6 +462,7 @@ enum wined3d_decoder_backend WINED3D_DECODER_BACKEND_AUTO, WINED3D_DECODER_BACKEND_VULKAN, WINED3D_DECODER_BACKEND_VA, + WINED3D_DECODER_BACKEND_NONE, }; #define WINED3D_CSMT_ENABLE 0x00000001 -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11720
On Fri Aug 21 09:00:31 2026 +0000, Stian Low wrote:
So `decoder_backend=none` may handle device failing for `D3D11_CREATE_DEVICE_VIDEO_SUPPORT` flag vs my patch to support `no_create_flags=0x800`? If so that seems to fulfill user freedom wants/needs. Maybe users will also need failing/overriding other flags besides 0x800 but it's the only high priority to fix UnityPlayer.dll videos so other flags besides 0x800 are much lower priority for now. Thanks for time and hard efforts. Since gl will take more work to support shared_resources than vulkan, `decoder_backend=none` should probably be default for gl in the meantime but not for vulkan which should probably default to supporting shared_resources instead and require users to explicitly use `decoder_backend=none` to force vulkan for fallback video playback.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/11720#note_149512
On Fri Aug 21 09:00:31 2026 +0000, Stian Low wrote:
Since gl will take more work to support shared_resources than vulkan, `decoder_backend=none` should probably be default for gl in the meantime but not for vulkan which should probably default to supporting shared_resources instead and require users to explicitly use `decoder_backend=none` to force vulkan for fallback video playback. The GL backend has never supported hardware decode, so it's already the default, or indeed the only option.
We could add VA support but I'm not sure whether it's worth the effort at this point. I don't think it's likely we'll ever get shared resource support for GL. It may depend on how quickly we can get Damavand to parity. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11720#note_149539
participants (5)
-
Elizabeth Figura -
Elizabeth Figura (@zfigura) -
Paul Gofman -
Stian Low -
Stian Low (@stianlow)