=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11/tests: Initialize texture data in test_update_subresource().

Alexandre Julliard julliard at winehq.org
Wed Nov 9 13:47:02 CST 2016


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Nov  9 12:35:23 2016 +0100

d3d11/tests: Initialize texture data in test_update_subresource().

Fixes test failures on Intel GPUs.

Signed-off-by: Józef Kucia <jkucia 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 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 38a3d65..d66f929 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -6781,6 +6781,7 @@ static void test_fragment_coords(void)
 static void test_update_subresource(void)
 {
     struct d3d11_test_context test_context;
+    D3D11_SUBRESOURCE_DATA resource_data;
     D3D11_TEXTURE2D_DESC texture_desc;
     ID3D11SamplerState *sampler_state;
     ID3D11ShaderResourceView *ps_srv;
@@ -6822,6 +6823,7 @@ static void test_update_subresource(void)
         0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e,
     };
     static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f};
+    static const DWORD initial_data[16] = {0};
     static const DWORD bitmap_data[] =
     {
         0xff0000ff, 0xff00ffff, 0xff00ff00, 0xffffff00,
@@ -6855,7 +6857,11 @@ static void test_update_subresource(void)
     texture_desc.CPUAccessFlags = 0;
     texture_desc.MiscFlags = 0;
 
-    hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, &texture);
+    resource_data.pSysMem = initial_data;
+    resource_data.SysMemPitch = texture_desc.Width * sizeof(*initial_data);
+    resource_data.SysMemSlicePitch = 0;
+
+    hr = ID3D11Device_CreateTexture2D(device, &texture_desc, &resource_data, &texture);
     ok(SUCCEEDED(hr), "Failed to create 2d texture, hr %#x.\n", hr);
 
     hr = ID3D11Device_CreateShaderResourceView(device, (ID3D11Resource *)texture, NULL, &ps_srv);




More information about the wine-cvs mailing list