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@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Józef Kucia 2018-11-21 15:14:02 +01:00 committed by Alexandre Julliard
parent efe867a2f6
commit 85d4482ccb
3 changed files with 11 additions and 9 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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: