From 85d4482ccbc7834918527e6fbc9049df0fbeaa3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Wed, 21 Nov 2018 15:14:02 +0100 Subject: [PATCH] wined3d: Implement WINED3D_QUERY_TYPE_SO_STATISTICS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 43fa65e280e..d4efad9d7df 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 5c6dfe00073..2f81a2c84ad 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 c0a14694090..d4e7cf5b37e 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: