wined3d: Rearrange wined3d_query_type enum values.

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>
This commit is contained in:
Józef Kucia 2017-06-05 00:47:38 +02:00 committed by Alexandre Julliard
parent 54a0ce3685
commit 10748ab9d8
2 changed files with 13 additions and 25 deletions

View File

@ -1066,6 +1066,12 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
{
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_so_statistics_query *object;
unsigned int stream_idx;
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
return WINED3DERR_NOTAVAILABLE;
TRACE("device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
device, type, parent, parent_ops, query);
@ -1084,27 +1090,9 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
switch (type)
{
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0:
object->stream_idx = 0;
break;
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM1:
object->stream_idx = 1;
break;
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM2:
object->stream_idx = 2;
break;
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3:
object->stream_idx = 3;
break;
default:
HeapFree(GetProcessHeap(), 0, object);
return WINED3DERR_NOTAVAILABLE;
}
wined3d_query_init(&object->query, device, type, &object->statistics,
sizeof(object->statistics), &so_statistics_query_ops, parent, parent_ops);
object->stream_idx = stream_idx;
TRACE("Created query %p.\n", object);
*query = &object->query;

View File

@ -705,12 +705,12 @@ enum wined3d_query_type
WINED3D_QUERY_TYPE_SO_STATISTICS = 21,
WINED3D_QUERY_TYPE_SO_OVERFLOW = 22,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM0 = 23,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM0 = 24,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM1 = 25,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM1 = 26,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM2 = 27,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM2 = 28,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3 = 29,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM1 = 24,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM2 = 25,
WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3 = 26,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM0 = 27,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM1 = 28,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM2 = 29,
WINED3D_QUERY_TYPE_SO_OVERFLOW_STREAM3 = 30,
};