Matteo Bruni : d3d11/tests: Test the creation of textures with invalid multisample settings.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Feb 5 08:24:18 CST 2016


Module: wine
Branch: master
Commit: b6f57778a50c398556d6e3a75c00327f81c89f96
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b6f57778a50c398556d6e3a75c00327f81c89f96

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Thu Feb  4 20:10:46 2016 +0100

d3d11/tests: Test the creation of textures with invalid multisample settings.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/tests/d3d11.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 3cb453f..4557215 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -508,6 +508,7 @@ static void test_create_texture2d(void)
     ID3D11Device *device, *tmp;
     D3D11_TEXTURE2D_DESC desc;
     ID3D11Texture2D *texture;
+    UINT quality_level_count;
     IDXGISurface *surface;
     HRESULT hr;
 
@@ -590,6 +591,25 @@ static void test_create_texture2d(void)
     ok(FAILED(hr), "Texture should not implement IDXGISurface.\n");
     ID3D11Texture2D_Release(texture);
 
+    ID3D11Device_CheckMultisampleQualityLevels(device, DXGI_FORMAT_R8G8B8A8_UNORM, 2, &quality_level_count);
+    desc.ArraySize = 1;
+    desc.SampleDesc.Count = 2;
+    hr = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture);
+    if (quality_level_count)
+    {
+        ok(SUCCEEDED(hr), "Got unexpected hr %#x.\n", hr);
+        ID3D11Texture2D_Release(texture);
+        desc.SampleDesc.Quality = quality_level_count;
+        hr = ID3D11Device_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 = ID3D11Device_CreateTexture2D(device, &desc, NULL, &texture);
+    ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
+
     refcount = ID3D11Device_Release(device);
     ok(!refcount, "Device has %u references left.\n", refcount);
 }




More information about the wine-cvs mailing list