Module: wine Branch: master Commit: 054ca9d7ca0b81068656d8c59658892711b433d1 URL: http://source.winehq.org/git/wine.git/?a=commit;h=054ca9d7ca0b81068656d8c596...
Author: Matteo Bruni mbruni@codeweavers.com Date: Thu Feb 4 20:10:48 2016 +0100
d3d10core/tests: Test the creation of textures with invalid multisample settings.
Signed-off-by: Matteo Bruni mbruni@codeweavers.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d10core/tests/device.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 633fc08..f2ef89d 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -305,6 +305,7 @@ static void test_create_texture2d(void) ID3D10Device *device, *tmp; D3D10_TEXTURE2D_DESC desc; ID3D10Texture2D *texture; + UINT quality_level_count; IDXGISurface *surface; HRESULT hr;
@@ -389,6 +390,25 @@ static void test_create_texture2d(void) if (SUCCEEDED(hr)) IDXGISurface_Release(surface); ID3D10Texture2D_Release(texture);
+ ID3D10Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_level_count); + desc.ArraySize = 1; + desc.SampleDesc.Count = 2; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + if (quality_level_count) + { + ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr); + ID3D10Texture2D_Release(texture); + desc.SampleDesc.Quality = quality_level_count; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + } + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + + /* We assume 15 samples multisampling is never supported in practice. */ + desc.SampleDesc.Count = 15; + desc.SampleDesc.Quality = 0; + hr = ID3D10Device_CreateTexture2D(device, &desc, NULL, &texture); + ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr); + refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); }