Rebase against 267e8e3eeb6d0b6e8ccab809fddd27bae05cbfc2.

This commit is contained in:
Sebastian Lackner 2016-07-23 16:30:17 +02:00
parent 5989fb0938
commit 7ca3f2b608
4 changed files with 129 additions and 97 deletions

View File

@ -51,7 +51,7 @@ usage()
# Get the upstream commit sha
upstream_commit()
{
echo "654e960e340cc37a9282c52ba8aca5f779a13dbb"
echo "267e8e3eeb6d0b6e8ccab809fddd27bae05cbfc2"
}
# Show version information

View File

@ -1,13 +1,13 @@
From 2353a70817f7f380819049b3d5b5d65a5d216e14 Mon Sep 17 00:00:00 2001
From a0114579d6805521af8d74adf7a09e40803f4425 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Sat, 6 Jul 2013 19:18:48 +0200
Subject: wined3d: Poll queries automatically in the CS
---
dlls/wined3d/cs.c | 76 ++++++--------
dlls/wined3d/query.c | 224 +++++++++++++++++++++++++++--------------
dlls/wined3d/query.c | 223 +++++++++++++++++++++++++++--------------
dlls/wined3d/wined3d_private.h | 7 +-
3 files changed, 186 insertions(+), 121 deletions(-)
3 files changed, 185 insertions(+), 121 deletions(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
index 94232db..213943f 100644
@ -143,7 +143,7 @@ index 94232db..213943f 100644
{
continue;
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 726da3b..7d743b7 100644
index fb948d7..d86dd30 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -35,6 +35,7 @@ static void wined3d_query_init(struct wined3d_query *query, struct wined3d_devic
@ -154,7 +154,7 @@ index 726da3b..7d743b7 100644
}
static struct wined3d_event_query *wined3d_event_query_from_query(struct wined3d_query *query)
@@ -302,7 +303,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
@@ -314,7 +315,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
TRACE("%p decreasing refcount to %u.\n", query, refcount);
if (!refcount)
@ -173,7 +173,7 @@ index 726da3b..7d743b7 100644
return refcount;
}
@@ -310,20 +322,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
@@ -322,20 +334,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
HRESULT CDECL wined3d_query_get_data(struct wined3d_query *query,
void *data, UINT data_size, DWORD flags)
{
@ -195,7 +195,7 @@ index 726da3b..7d743b7 100644
}
UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query)
@@ -353,14 +355,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -365,14 +367,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
void *data, DWORD size, DWORD flags)
{
struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query);
@ -210,7 +210,7 @@ index 726da3b..7d743b7 100644
if (!oq->context)
query->state = QUERY_CREATED;
@@ -374,6 +369,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -386,6 +381,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return S_OK;
}
@ -219,7 +219,7 @@ index 726da3b..7d743b7 100644
if (query->state == QUERY_BUILDING)
{
/* Msdn says this returns an error, but our tests show that S_FALSE is returned */
@@ -381,12 +378,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -393,12 +390,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return S_FALSE;
}
@ -260,7 +260,7 @@ index 726da3b..7d743b7 100644
}
context = context_acquire(device, context_get_rt_surface(oq->context));
@@ -397,61 +419,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -409,61 +431,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
if (available)
{
@ -360,7 +360,7 @@ index 726da3b..7d743b7 100644
return S_OK;
}
@@ -571,33 +603,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
@@ -583,33 +615,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
void *data, DWORD size, DWORD flags)
{
struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query);
@ -402,10 +402,10 @@ index 726da3b..7d743b7 100644
GLuint available;
GLuint64 timestamp;
- HRESULT res;
-
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
+ BOOL ret;
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
-
- if (!tq->context)
- query->state = QUERY_CREATED;
-
@ -433,7 +433,7 @@ index 726da3b..7d743b7 100644
}
context = context_acquire(device, context_get_rt_surface(tq->context));
@@ -608,23 +664,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
@@ -620,23 +676,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
if (available)
{
@ -464,7 +464,7 @@ index 726da3b..7d743b7 100644
}
static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags)
@@ -658,7 +711,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
@@ -670,7 +723,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
void *data, DWORD size, DWORD flags)
{
TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
@ -472,7 +472,7 @@ index 726da3b..7d743b7 100644
if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
{
static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE};
@@ -680,6 +732,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
@@ -692,6 +744,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
return S_OK;
}
@ -484,7 +484,7 @@ index 726da3b..7d743b7 100644
static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags)
{
TRACE("query %p, flags %#x.\n", query, flags);
@@ -702,6 +759,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
@@ -714,6 +771,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
return S_OK;
}
@ -496,7 +496,7 @@ index 726da3b..7d743b7 100644
static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags)
{
FIXME("query %p, flags %#x.\n", query, flags);
@@ -719,6 +781,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
@@ -731,6 +793,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
return S_OK;
}
@ -508,7 +508,7 @@ index 726da3b..7d743b7 100644
static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags)
{
FIXME("query %p, flags %#x.\n", query, flags);
@@ -727,6 +794,7 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
@@ -739,6 +806,7 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
static const struct wined3d_query_ops event_query_ops =
{
wined3d_event_query_ops_get_data,
@ -516,7 +516,7 @@ index 726da3b..7d743b7 100644
wined3d_event_query_ops_issue,
};
@@ -758,6 +826,7 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device,
@@ -770,6 +838,7 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops occlusion_query_ops =
{
wined3d_occlusion_query_ops_get_data,
@ -524,7 +524,7 @@ index 726da3b..7d743b7 100644
wined3d_occlusion_query_ops_issue,
};
@@ -789,6 +858,7 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device,
@@ -801,6 +870,7 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops timestamp_query_ops =
{
wined3d_timestamp_query_ops_get_data,
@ -532,7 +532,7 @@ index 726da3b..7d743b7 100644
wined3d_timestamp_query_ops_issue,
};
@@ -820,18 +890,21 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device,
@@ -832,6 +902,7 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops timestamp_disjoint_query_ops =
{
wined3d_timestamp_disjoint_query_ops_get_data,
@ -540,6 +540,7 @@ index 726da3b..7d743b7 100644
wined3d_timestamp_disjoint_query_ops_issue,
};
@@ -867,6 +938,7 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de
static const struct wined3d_query_ops statistics_query_ops =
{
wined3d_statistics_query_ops_get_data,
@ -547,21 +548,14 @@ index 726da3b..7d743b7 100644
wined3d_statistics_query_ops_issue,
};
@@ -892,6 +964,7 @@ static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops overflow_query_ops =
{
wined3d_overflow_query_ops_get_data,
+ wined3d_overflow_query_ops_poll,
wined3d_overflow_query_ops_issue
wined3d_overflow_query_ops_issue,
};
@@ -887,6 +960,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
query->state = QUERY_CREATED;
query->device = device;
query->ref = 1;
+ list_init(&query->poll_list_entry);
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 232f099..3688ef9 100644
--- a/dlls/wined3d/wined3d_private.h

View File

@ -5062,7 +5062,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
/* Queries are specific to the GL context that created them. Not
* deleting the query will obviously leak it, but that's still better
* than potentially deleting a different query with the same id in this
@@ -327,7 +335,21 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
@@ -339,7 +347,21 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
{
TRACE("query %p, flags %#x.\n", query, flags);
@ -5084,7 +5084,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size)
@@ -339,6 +361,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -351,6 +373,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
void *data, DWORD size, DWORD flags)
{
struct wined3d_occlusion_query *oq = wined3d_occlusion_query_from_query(query);
@ -5092,7 +5092,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
struct wined3d_device *device = query->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct wined3d_context *context;
@@ -350,6 +373,9 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -362,6 +385,9 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
if (!oq->context)
query->state = QUERY_CREATED;
@ -5102,7 +5102,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (query->state == QUERY_CREATED)
{
@@ -360,6 +386,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -372,6 +398,10 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return S_OK;
}
@ -5113,7 +5113,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (query->state == QUERY_BUILDING)
{
/* Msdn says this returns an error, but our tests show that S_FALSE is returned */
@@ -367,12 +397,45 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -379,12 +409,45 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
return S_FALSE;
}
@ -5159,7 +5159,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
context = context_acquire(device, context_get_rt_surface(oq->context));
@@ -383,6 +446,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -395,6 +458,7 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
if (available)
{
@ -5167,7 +5167,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (size)
{
GL_EXTCALL(glGetQueryObjectuiv(oq->id, GL_QUERY_RESULT, &samples));
@@ -391,34 +455,55 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
@@ -403,34 +467,55 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
fill_query_data(data, size, &samples, sizeof(samples));
}
res = S_OK;
@ -5223,7 +5223,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
signaled = TRUE;
fill_query_data(data, size, &signaled, sizeof(signaled));
break;
@@ -427,17 +512,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
@@ -439,17 +524,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
signaled = FALSE;
fill_query_data(data, size, &signaled, sizeof(signaled));
break;
@ -5282,7 +5282,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
return S_OK;
}
@@ -456,7 +582,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
@@ -468,7 +594,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
return query->type;
}
@ -5294,7 +5294,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
{
TRACE("query %p, flags %#x.\n", query, flags);
@@ -465,12 +595,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
@@ -477,12 +607,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
struct wined3d_event_query *event_query = wined3d_event_query_from_query(query);
wined3d_event_query_issue(event_query, query->device);
@ -5311,7 +5311,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (flags & WINED3DISSUE_BEGIN)
query->state = QUERY_BUILDING;
@@ -481,11 +615,20 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
@@ -493,11 +627,20 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
}
static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD flags)
@ -5332,7 +5332,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
TRACE("query %p, flags %#x.\n", query, flags);
@@ -493,7 +636,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
@@ -505,7 +648,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
* restart. */
if (flags & WINED3DISSUE_BEGIN)
{
@ -5344,7 +5344,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
{
if (oq->context->tid != GetCurrentThreadId())
{
@@ -523,13 +670,20 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
@@ -535,13 +682,20 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
checkGLcall("glBeginQuery()");
context_release(context);
@ -5365,7 +5365,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
{
if (oq->context->tid != GetCurrentThreadId())
{
@@ -543,6 +697,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
@@ -555,6 +709,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
checkGLcall("glEndQuery()");
context_release(context);
@ -5373,7 +5373,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
}
}
@@ -553,17 +708,61 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
@@ -565,17 +720,61 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
query->state = QUERY_SIGNALLED;
return WINED3D_OK; /* can be WINED3DERR_INVALIDCALL. */
@ -5435,7 +5435,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
HRESULT res;
TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
@@ -578,14 +777,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
@@ -590,14 +789,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
timestamp = 0;
fill_query_data(data, size, &timestamp, sizeof(timestamp));
return S_OK;
@ -5464,7 +5464,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
context = context_acquire(device, context_get_rt_surface(tq->context));
@@ -596,6 +809,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
@@ -608,6 +821,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
if (available)
{
@ -5472,7 +5472,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (size)
{
GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, &timestamp));
@@ -604,18 +818,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
@@ -616,18 +830,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
fill_query_data(data, size, &timestamp, sizeof(timestamp));
}
res = S_OK;
@ -5509,7 +5509,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
{
struct wined3d_timestamp_query *tq = wined3d_timestamp_query_from_query(query);
struct wined3d_device *device = query->device;
@@ -637,18 +869,28 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
@@ -649,18 +881,28 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
GL_EXTCALL(glQueryCounter(tq->id, GL_TIMESTAMP));
checkGLcall("glQueryCounter()");
context_release(context);
@ -5538,7 +5538,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
{
static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE};
@@ -670,6 +912,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
@@ -682,6 +924,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
return S_OK;
}
@ -5546,7 +5546,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags)
{
TRACE("query %p, flags %#x.\n", query, flags);
@@ -680,6 +923,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
@@ -692,6 +935,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
query->state = QUERY_SIGNALLED;
return WINED3D_OK;
@ -5564,7 +5564,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query,
@@ -694,10 +948,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
@@ -706,10 +960,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
return S_OK;
}
@ -5587,7 +5587,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
}
static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
@@ -712,15 +978,30 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
@@ -724,15 +990,30 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
return S_OK;
}
@ -5618,7 +5618,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
wined3d_event_query_ops_issue,
};
@@ -752,6 +1033,9 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device,
@@ -764,6 +1045,9 @@ static HRESULT wined3d_event_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops occlusion_query_ops =
{
wined3d_occlusion_query_ops_get_data,
@ -5628,7 +5628,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
wined3d_occlusion_query_ops_issue,
};
@@ -783,6 +1067,9 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device,
@@ -795,6 +1079,9 @@ static HRESULT wined3d_occlusion_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops timestamp_query_ops =
{
wined3d_timestamp_query_ops_get_data,
@ -5638,7 +5638,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
wined3d_timestamp_query_ops_issue,
};
@@ -814,18 +1101,27 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device,
@@ -826,6 +1113,9 @@ static HRESULT wined3d_timestamp_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops timestamp_disjoint_query_ops =
{
wined3d_timestamp_disjoint_query_ops_get_data,
@ -5648,6 +5648,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
wined3d_timestamp_disjoint_query_ops_issue,
};
@@ -861,6 +1151,9 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de
static const struct wined3d_query_ops statistics_query_ops =
{
wined3d_statistics_query_ops_get_data,
@ -5657,25 +5658,16 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
wined3d_statistics_query_ops_issue,
};
@@ -886,6 +1179,9 @@ static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,
static const struct wined3d_query_ops overflow_query_ops =
{
wined3d_overflow_query_ops_get_data,
+#if defined(STAGING_CSMT)
+ wined3d_overflow_query_ops_poll,
+#endif /* STAGING_CSMT */
wined3d_overflow_query_ops_issue
wined3d_overflow_query_ops_issue,
};
@@ -881,6 +1177,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
query->state = QUERY_CREATED;
query->device = device;
query->ref = 1;
+#if defined(STAGING_CSMT)
+ list_init(&query->poll_list_entry);
+#endif /* STAGING_CSMT */
return WINED3D_OK;
}
diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c
--- a/dlls/wined3d/resource.c
+++ b/dlls/wined3d/resource.c

View File

@ -1,15 +1,15 @@
From 1295d2929164a855aee33f52350cf457f8028ff9 Mon Sep 17 00:00:00 2001
From 148ec0e10734a650f5c8988d5c173eb7e98e9449 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sat, 16 Apr 2016 18:18:54 +0200
Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and
QUERY_TYPE_SO_OVERFLOW.
---
dlls/d3d10core/tests/device.c | 4 +--
dlls/d3d11/tests/d3d11.c | 4 +--
dlls/wined3d/query.c | 60 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 6 +++++
4 files changed, 70 insertions(+), 4 deletions(-)
dlls/d3d10core/tests/device.c | 4 +-
dlls/d3d11/tests/d3d11.c | 4 +-
dlls/wined3d/query.c | 99 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 6 +++
4 files changed, 109 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 9b3a943..fb1ec06 100644
@ -42,10 +42,25 @@ index df45eb5..4c65997 100644
{D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, D3D_FEATURE_LEVEL_11_0, TRUE, FALSE, TRUE},
{D3D11_QUERY_SO_STATISTICS_STREAM1, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, TRUE},
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 976cdd9..ef93d3b 100644
index 591d6c5..2d1da66 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -682,6 +682,42 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
@@ -293,6 +293,14 @@ static void wined3d_query_destroy_object(void *object)
{
HeapFree(GetProcessHeap(), 0, query);
}
+ else if (query->type == WINED3D_QUERY_TYPE_SO_STATISTICS)
+ {
+ HeapFree(GetProcessHeap(), 0, query);
+ }
+ else if (query->type == WINED3D_QUERY_TYPE_SO_OVERFLOW)
+ {
+ HeapFree(GetProcessHeap(), 0, query);
+ }
else
{
ERR("Query %p has invalid type %#x.\n", query, query->type);
@@ -686,6 +694,42 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
return WINED3D_OK;
}
@ -88,9 +103,9 @@ index 976cdd9..ef93d3b 100644
static const struct wined3d_query_ops event_query_ops =
{
wined3d_event_query_ops_get_data,
@@ -781,6 +817,18 @@ static const struct wined3d_query_ops timestamp_disjoint_query_ops =
wined3d_timestamp_disjoint_query_ops_issue,
};
@@ -814,6 +858,55 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de
return WINED3D_OK;
}
+static const struct wined3d_query_ops statistics_query_ops =
+{
@ -98,34 +113,65 @@ index 976cdd9..ef93d3b 100644
+ wined3d_statistics_query_ops_issue,
+};
+
+static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,
+ enum wined3d_query_type type, void *parent, struct wined3d_query **query)
+{
+ struct wined3d_query *object;
+
+ FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query);
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ wined3d_query_init(object, device, type,
+ sizeof(struct wined3d_query_data_so_statistics), &statistics_query_ops, parent);
+
+ TRACE("Created query %p.\n", object);
+ *query = object;
+
+ return WINED3D_OK;
+}
+
+static const struct wined3d_query_ops overflow_query_ops =
+{
+ wined3d_overflow_query_ops_get_data,
+ wined3d_overflow_query_ops_issue
+ wined3d_overflow_query_ops_issue,
+};
+
static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *device,
enum wined3d_query_type type, void *parent)
+static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
+ enum wined3d_query_type type, void *parent, struct wined3d_query **query)
+{
+ struct wined3d_query *object;
+
+ FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query);
+
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
+ return E_OUTOFMEMORY;
+
+ wined3d_query_init(object, device, type, sizeof(BOOL), &overflow_query_ops, parent);
+
+ TRACE("Created query %p.\n", object);
+ *query = object;
+
+ return WINED3D_OK;
+}
+
HRESULT CDECL wined3d_query_create(struct wined3d_device *device,
enum wined3d_query_type type, void *parent, struct wined3d_query **query)
{
@@ -790,6 +838,18 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
@@ -834,6 +927,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device,
case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ:
return wined3d_timestamp_disjoint_query_create(device, type, parent, query);
switch (type)
{
+ case WINED3D_QUERY_TYPE_SO_STATISTICS:
+ FIXME("Statistics query.\n");
+ query->query_ops = &statistics_query_ops;
+ query->data_size = sizeof(struct wined3d_query_data_so_statistics);
+ break;
+ return wined3d_statistics_query_create(device, type, parent, query);
+
+ case WINED3D_QUERY_TYPE_SO_OVERFLOW:
+ FIXME("Overflow query.\n");
+ query->query_ops = &overflow_query_ops;
+ query->data_size = sizeof(BOOL);
+ break;
+ return wined3d_overflow_query_create(device, type, parent, query);
+
case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT:
case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ:
TRACE("TIMESTAMP_DISJOINT query.\n");
default:
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 36de1de..468ce98 100644
--- a/include/wine/wined3d.h