=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Implement WINED3D_QUERY_TYPE_SO_STATISTICS.

Alexandre Julliard julliard at winehq.org
Wed Nov 21 16:08:07 CST 2018


Module: wine
Branch: master
Commit: 85d4482ccbc7834918527e6fbc9049df0fbeaa3e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=85d4482ccbc7834918527e6fbc9049df0fbeaa3e

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Nov 21 15:14:02 2018 +0100

wined3d: Implement WINED3D_QUERY_TYPE_SO_STATISTICS.

The WINED3D_QUERY_TYPE_SO_STATISTICS query type is just
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0, but it is supported on feature
level 10.

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/d3d10core/tests/d3d10core.c | 9 +++++----
 dlls/d3d11/tests/d3d11.c         | 8 +++-----
 dlls/wined3d/query.c             | 3 +++
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c
index 43fa65e..d4efad9 100644
--- a/dlls/d3d10core/tests/d3d10core.c
+++ b/dlls/d3d10core/tests/d3d10core.c
@@ -4377,7 +4377,7 @@ static void test_create_query(void)
         {D3D10_QUERY_TIMESTAMP_DISJOINT,    FALSE, FALSE},
         {D3D10_QUERY_PIPELINE_STATISTICS,   FALSE, FALSE},
         {D3D10_QUERY_OCCLUSION_PREDICATE,   TRUE,  FALSE},
-        {D3D10_QUERY_SO_STATISTICS,         FALSE, TRUE},
+        {D3D10_QUERY_SO_STATISTICS,         FALSE, FALSE},
         {D3D10_QUERY_SO_OVERFLOW_PREDICATE, TRUE,  TRUE},
     };
 
@@ -4813,9 +4813,7 @@ static void test_so_statistics_query(void)
     query_desc.Query = D3D10_QUERY_SO_STATISTICS;
     query_desc.MiscFlags = 0;
     hr = ID3D10Device_CreateQuery(device, &query_desc, (ID3D10Query **)&query);
-    todo_wine
     ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
-    if (FAILED(hr)) goto done;
     data_size = ID3D10Asynchronous_GetDataSize(query);
     ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
 
@@ -4829,8 +4827,10 @@ static void test_so_statistics_query(void)
     ID3D10Asynchronous_Begin(query);
 
     hr = ID3D10Asynchronous_GetData(query, NULL, 0, 0);
+    todo_wine
     ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
     hr = ID3D10Asynchronous_GetData(query, &data, sizeof(data), 0);
+    todo_wine
     ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
 
     draw_quad(&test_context);
@@ -4839,6 +4839,7 @@ static void test_so_statistics_query(void)
     get_query_data(query, &data, sizeof(data));
     ok(!data.NumPrimitivesWritten, "Got unexpected NumPrimitivesWritten: %u.\n",
             (unsigned int)data.NumPrimitivesWritten);
+    todo_wine
     ok(!data.PrimitivesStorageNeeded, "Got unexpected PrimitivesStorageNeeded: %u.\n",
             (unsigned int)data.PrimitivesStorageNeeded);
 
@@ -4848,11 +4849,11 @@ static void test_so_statistics_query(void)
     get_query_data(query, &data, sizeof(data));
     ok(!data.NumPrimitivesWritten, "Got unexpected NumPrimitivesWritten: %u.\n",
             (unsigned int)data.NumPrimitivesWritten);
+    todo_wine
     ok(!data.PrimitivesStorageNeeded, "Got unexpected PrimitivesStorageNeeded: %u.\n",
             (unsigned int)data.PrimitivesStorageNeeded);
 
     ID3D10Asynchronous_Release(query);
-done:
     release_test_context(&test_context);
 }
 
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 5c6dfe0..2f81a2c 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -5292,7 +5292,7 @@ static void test_create_query(void)
         {D3D11_QUERY_TIMESTAMP_DISJOINT,            D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
         {D3D11_QUERY_PIPELINE_STATISTICS,           D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
         {D3D11_QUERY_OCCLUSION_PREDICATE,           D3D_FEATURE_LEVEL_10_0, TRUE,  TRUE,  FALSE},
-        {D3D11_QUERY_SO_STATISTICS,                 D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
+        {D3D11_QUERY_SO_STATISTICS,                 D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
         {D3D11_QUERY_SO_OVERFLOW_PREDICATE,         D3D_FEATURE_LEVEL_10_0, TRUE,  TRUE,  TRUE},
         {D3D11_QUERY_SO_STATISTICS_STREAM0,         D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, FALSE},
         {D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, D3D_FEATURE_LEVEL_11_0, TRUE,  FALSE, TRUE},
@@ -5839,9 +5839,7 @@ static void test_so_statistics_query(void)
         query_desc.Query = tests[i].query;
         query_desc.MiscFlags = 0;
         hr = ID3D11Device_CreateQuery(device, &query_desc, (ID3D11Query **)&query);
-        todo_wine_if(query_desc.Query == D3D11_QUERY_SO_STATISTICS)
         ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
-        if (FAILED(hr)) continue;
         data_size = ID3D11Asynchronous_GetDataSize(query);
         ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
 
@@ -5868,7 +5866,7 @@ static void test_so_statistics_query(void)
         get_query_data(context, query, &data, sizeof(data));
         ok(!data.NumPrimitivesWritten, "Got unexpected NumPrimitivesWritten: %u.\n",
                 (unsigned int)data.NumPrimitivesWritten);
-        todo_wine_if(query_desc.Query == D3D11_QUERY_SO_STATISTICS_STREAM0)
+        todo_wine_if(query_desc.Query == D3D11_QUERY_SO_STATISTICS || query_desc.Query == D3D11_QUERY_SO_STATISTICS_STREAM0)
         ok(!data.PrimitivesStorageNeeded, "Got unexpected PrimitivesStorageNeeded: %u.\n",
                 (unsigned int)data.PrimitivesStorageNeeded);
 
@@ -5878,7 +5876,7 @@ static void test_so_statistics_query(void)
         get_query_data(context, query, &data, sizeof(data));
         ok(!data.NumPrimitivesWritten, "Got unexpected NumPrimitivesWritten: %u.\n",
                 (unsigned int)data.NumPrimitivesWritten);
-        todo_wine_if(query_desc.Query == D3D11_QUERY_SO_STATISTICS_STREAM0)
+        todo_wine_if(query_desc.Query == D3D11_QUERY_SO_STATISTICS || query_desc.Query == D3D11_QUERY_SO_STATISTICS_STREAM0)
         ok(!data.PrimitivesStorageNeeded, "Got unexpected PrimitivesStorageNeeded: %u.\n",
                 (unsigned int)data.PrimitivesStorageNeeded);
 
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index c0a1469..d4e7cf5 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1259,6 +1259,8 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
 
     if (WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0 <= type && type <= WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3)
         stream_idx = type - WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0;
+    else if (type == WINED3D_QUERY_TYPE_SO_STATISTICS)
+        stream_idx = 0;
     else
         return WINED3DERR_NOTAVAILABLE;
 
@@ -1353,6 +1355,7 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
         case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ:
             return wined3d_timestamp_disjoint_query_create(device, type, parent, parent_ops, query);
 
+        case WINED3D_QUERY_TYPE_SO_STATISTICS:
         case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0:
         case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM1:
         case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM2:




More information about the wine-cvs mailing list