Commit c0fb3fb9 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Increase data size for occlusion queries to 8 bytes.

parent eacb2f91
......@@ -4654,7 +4654,7 @@ static void test_occlusion_query(void)
hr = ID3D11Device_CreateQuery(device, &query_desc, (ID3D11Query **)&query);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
data_size = ID3D11Asynchronous_GetDataSize(query);
todo_wine ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
ok(data_size == sizeof(data), "Got unexpected data size %u.\n", data_size);
hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0);
todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Got unexpected hr %#x.\n", hr);
......@@ -4686,19 +4686,19 @@ static void test_occlusion_query(void)
memset(&data, 0xff, sizeof(data));
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
todo_wine ok(data.uint == 640 * 480, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(data.uint == 640 * 480, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
memset(&data, 0xff, sizeof(data));
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(DWORD), 0);
todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(WORD), 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data) - 1, 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data) + 1, 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
todo_wine ok(data.dword[0] == 0xffffffff && data.dword[1] == 0xffffffff,
ok(data.dword[0] == 0xffffffff && data.dword[1] == 0xffffffff,
"Data was modified 0x%08x%08x.\n", data.dword[1], data.dword[0]);
memset(&data, 0xff, sizeof(data));
......@@ -4708,9 +4708,9 @@ static void test_occlusion_query(void)
"Data was modified 0x%08x%08x.\n", data.dword[1], data.dword[0]);
hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(DWORD), 0);
todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(data), 0);
ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, NULL, sizeof(data), 0);
todo_wine ok(hr == E_INVALIDARG, "Got unexpected hr %#x.\n", hr);
ID3D11DeviceContext_Begin(context, query);
ID3D11DeviceContext_End(context, query);
......@@ -4729,8 +4729,8 @@ static void test_occlusion_query(void)
hr = ID3D11DeviceContext_GetData(context, query, NULL, 0, 0);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
hr = ID3D11DeviceContext_GetData(context, query, &data, sizeof(data), 0);
todo_wine ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
todo_wine ok(!data.uint, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
ok(!data.uint, "Got unexpected query result 0x%08x%08x.\n", data.dword[1], data.dword[0]);
ID3D11Asynchronous_Release(query);
release_test_context(&test_context);
......
......@@ -115,7 +115,9 @@ static DWORD WINAPI d3d9_query_GetDataSize(IDirect3DQuery9 *iface)
wined3d_mutex_lock();
type = wined3d_query_get_type(query->wined3d_query);
if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
if (type == WINED3D_QUERY_TYPE_OCCLUSION)
ret = sizeof(DWORD);
else if (type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
ret = sizeof(BOOL);
else
ret = wined3d_query_get_data_size(query->wined3d_query);
......
......@@ -386,9 +386,11 @@ static BOOL wined3d_occlusion_query_ops_poll(struct wined3d_query *query)
if (available)
{
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &oq->samples));
GLuint result;
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &result));
checkGLcall("glGetQueryObjectuiv(GL_QUERY_RESULT)");
TRACE("Returning %u samples.\n", oq->samples);
oq->samples = result;
TRACE("Returning 0x%s samples.\n", wine_dbgstr_longlong(oq->samples));
}
context_release(context);
......
......@@ -1431,7 +1431,7 @@ struct wined3d_occlusion_query
struct list entry;
GLuint id;
struct wined3d_context *context;
DWORD samples;
UINT64 samples;
};
struct wined3d_timestamp_query
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment