[PATCH 2/6] d3d11: Implement d3d10_device_CheckMultisampleQualityLevels().
Matteo Bruni
mbruni at codeweavers.com
Thu Jan 28 17:51:23 CST 2016
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
dlls/d3d10core/tests/device.c | 5 ++---
dlls/d3d11/device.c | 33 +++++++++++++++++++++++++++++++--
2 files changed, 33 insertions(+), 5 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 92ae1cf..d267471 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -5002,7 +5002,7 @@ static void test_multisample_init(void)
}
hr = ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &count);
- todo_wine ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr);
+ ok(SUCCEEDED(hr), "Failed to get quality levels, hr %#x.\n", hr);
if (!count)
{
skip("Multisampling not supported for DXGI_FORMAT_R8G8B8A8_UNORM, skipping tests.\n");
@@ -5032,7 +5032,6 @@ static void test_multisample_init(void)
hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &multi);
ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
- ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
ID3D10Device_ResolveSubresource(device, (ID3D10Resource *)backbuffer, 0,
(ID3D10Resource *)multi, 0, DXGI_FORMAT_R8G8B8A8_UNORM);
@@ -5052,7 +5051,7 @@ static void test_multisample_init(void)
break;
}
release_texture_readback(&rb);
- ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y);
+ todo_wine ok(all_zero, "Got unexpected color 0x%08x, position %ux%u.\n", color, x, y);
ID3D10RenderTargetView_Release(rtview);
ID3D10Texture2D_Release(backbuffer);
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 785e537..e7d2521 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -4501,10 +4501,39 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *
static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface,
DXGI_FORMAT format, UINT sample_count, UINT *quality_level_count)
{
- FIXME("iface %p, format %s, sample_count %u, quality_level_count %p stub!\n",
+ struct d3d_device *device = impl_from_ID3D10Device(iface);
+ HRESULT hr;
+
+ TRACE("iface %p, format %s, sample_count %u, quality_level_count %p.\n",
iface, debug_dxgi_format(format), sample_count, quality_level_count);
- return E_NOTIMPL;
+ if (!quality_level_count)
+ return E_INVALIDARG;
+
+ *quality_level_count = 0;
+
+ if (!sample_count)
+ return E_FAIL;
+ if (sample_count == 1)
+ {
+ *quality_level_count = 1;
+ return S_OK;
+ }
+ if (sample_count > 32)
+ return E_FAIL;
+
+ if (sample_count > 16)
+ {
+ FIXME("sample_count %u not handled yet.\n", sample_count);
+ return S_OK;
+ }
+ hr = wined3d_device_check_multisample_quality_levels(device->wined3d_device,
+ wined3dformat_from_dxgi_format(format), sample_count, quality_level_count);
+ if (hr == WINED3DERR_INVALIDCALL)
+ return E_INVALIDARG;
+ if (hr == WINED3DERR_NOTAVAILABLE)
+ return S_OK;
+ return hr;
}
static void STDMETHODCALLTYPE d3d10_device_CheckCounterInfo(ID3D10Device1 *iface, D3D10_COUNTER_INFO *counter_info)
--
2.4.10
More information about the wine-patches
mailing list