From 0be12d7669bf8b27d12f76c2d463a5f656b17cae Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Sat, 4 Mar 2017 18:55:10 +0100 Subject: [PATCH] Added patch for semi-stub of d3d10_device_CheckFormatSupport. --- patches/patchinstall.sh | 5 +- ...ment-ID3D10Device_CheckFormatSupport.patch | 58 +++++++++++++++++++ 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 patches/wined3d-check_format_support/0003-d3d11-Implement-ID3D10Device_CheckFormatSupport.patch diff --git a/patches/patchinstall.sh b/patches/patchinstall.sh index bbd7c526..9a0422b2 100755 --- a/patches/patchinstall.sh +++ b/patches/patchinstall.sh @@ -8335,14 +8335,17 @@ fi # Patchset wined3d-check_format_support # | # | Modified files: -# | * dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/device.c, dlls/wined3d/wined3d.spec, include/wine/wined3d.h +# | * dlls/d3d10core/tests/device.c, dlls/d3d11/device.c, dlls/d3d11/tests/d3d11.c, dlls/wined3d/device.c, +# | dlls/wined3d/wined3d.spec, include/wine/wined3d.h # | if test "$enable_wined3d_check_format_support" -eq 1; then patch_apply wined3d-check_format_support/0001-wined3d-Add-wined3d_check_device_format_support.patch patch_apply wined3d-check_format_support/0002-d3d11-Implement-ID3D11Device_CheckFormatSupport.patch + patch_apply wined3d-check_format_support/0003-d3d11-Implement-ID3D10Device_CheckFormatSupport.patch ( printf '%s\n' '+ { "Michael Müller", "wined3d: Add wined3d_check_device_format_support.", 1 },'; printf '%s\n' '+ { "Michael Müller", "d3d11: Implement ID3D11Device_CheckFormatSupport.", 1 },'; + printf '%s\n' '+ { "Michael Müller", "d3d11: Implement ID3D10Device_CheckFormatSupport.", 1 },'; ) >> "$patchlist" fi diff --git a/patches/wined3d-check_format_support/0003-d3d11-Implement-ID3D10Device_CheckFormatSupport.patch b/patches/wined3d-check_format_support/0003-d3d11-Implement-ID3D10Device_CheckFormatSupport.patch new file mode 100644 index 00000000..e5df8496 --- /dev/null +++ b/patches/wined3d-check_format_support/0003-d3d11-Implement-ID3D10Device_CheckFormatSupport.patch @@ -0,0 +1,58 @@ +From 1ec823158412e5250d763c6b2550781a3127e59a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Michael=20M=C3=BCller?= +Date: Tue, 28 Feb 2017 23:04:04 +0100 +Subject: d3d11: Implement ID3D10Device_CheckFormatSupport. + +--- + dlls/d3d10core/tests/device.c | 2 +- + dlls/d3d11/device.c | 20 +++++++++++++++++--- + 2 files changed, 18 insertions(+), 4 deletions(-) + +diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c +index 7b27d9f6a4c..21dd1bc8dbf 100644 +--- a/dlls/d3d10core/tests/device.c ++++ b/dlls/d3d10core/tests/device.c +@@ -10076,7 +10076,7 @@ static void test_required_format_support(void) + for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format) + { + hr = ID3D10Device_CheckFormatSupport(device, format, &format_support[format]); +- todo_wine ok(hr == S_OK || (hr == E_FAIL && !format_support[format]), ++ ok(hr == S_OK || (hr == E_FAIL && !format_support[format]), + "Got unexpected result for format %#x: hr %#x, format_support %#x.\n", + format, hr, format_support[format]); + } +diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c +index ef8d01696e7..5a1c28a4857 100644 +--- a/dlls/d3d11/device.c ++++ b/dlls/d3d11/device.c +@@ -7274,10 +7274,24 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface + static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface, + DXGI_FORMAT format, UINT *format_support) + { +- FIXME("iface %p, format %s, format_support %p stub!\n", +- iface, debug_dxgi_format(format), format_support); ++ struct d3d_device *device = impl_from_ID3D10Device(iface); ++ enum wined3d_format_id d3d_format; + +- return E_NOTIMPL; ++ FIXME("iface %p, format %s, format_support %p semi-stub!\n", ++ iface, debug_dxgi_format(format), format_support); ++ ++ if (!format_support) ++ return E_INVALIDARG; ++ ++ d3d_format = wined3dformat_from_dxgi_format(format); ++ if (d3d_format == WINED3DFMT_UNKNOWN) ++ return E_FAIL; ++ ++ wined3d_mutex_lock(); ++ wined3d_check_device_format_support(device->wined3d_device, d3d_format, format_support); ++ wined3d_mutex_unlock(); ++ ++ return S_OK; + } + + static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface, +-- +2.11.0 +