mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 0a5e205c06e0f0ccf632e02a48e86a386a4884e0.
This commit is contained in:
parent
4d1dd4c62a
commit
94f533c0ad
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "a615647435bd017af1993454902982d7a37b3cb3"
|
||||
echo "0a5e205c06e0f0ccf632e02a48e86a386a4884e0"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
|
@ -1,18 +1,18 @@
|
||||
From 8115985c8499fcfddbb2aea9d5e8182fffaf82c3 Mon Sep 17 00:00:00 2001
|
||||
From bcb7a976e21e8bf74e52d2169943fd0bd1f736c2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 6 Jul 2013 18:15:00 +0200
|
||||
Subject: wined3d: wined3d_*_query_issue never fails
|
||||
|
||||
---
|
||||
dlls/wined3d/query.c | 27 ++++++++++-----------------
|
||||
dlls/wined3d/query.c | 25 +++++++++----------------
|
||||
dlls/wined3d/wined3d_private.h | 2 +-
|
||||
2 files changed, 11 insertions(+), 18 deletions(-)
|
||||
2 files changed, 10 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index 0c56b23..ad763ef 100644
|
||||
index 7ef879d..ffa3f62 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -292,7 +292,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
|
||||
@@ -297,7 +297,8 @@ HRESULT CDECL wined3d_query_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@ -22,7 +22,7 @@ index 0c56b23..ad763ef 100644
|
||||
}
|
||||
|
||||
static void fill_query_data(void *out, unsigned int out_size, const void *result, unsigned int result_size)
|
||||
@@ -435,7 +436,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
@@ -434,7 +435,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
return query->type;
|
||||
}
|
||||
|
||||
@ -31,16 +31,7 @@ index 0c56b23..ad763ef 100644
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -445,7 +446,7 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
struct wined3d_event_query *event_query = query->extendedData;
|
||||
|
||||
/* Faked event query support */
|
||||
- if (!event_query) return WINED3D_OK;
|
||||
+ if (!event_query) return;
|
||||
|
||||
wined3d_event_query_issue(event_query, query->device);
|
||||
}
|
||||
@@ -459,11 +460,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -455,11 +456,9 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
query->state = QUERY_BUILDING;
|
||||
else
|
||||
query->state = QUERY_SIGNALLED;
|
||||
@ -53,7 +44,7 @@ index 0c56b23..ad763ef 100644
|
||||
{
|
||||
struct wined3d_device *device = query->device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
@@ -542,7 +541,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -538,7 +537,7 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
else
|
||||
query->state = QUERY_SIGNALLED;
|
||||
|
||||
@ -62,7 +53,7 @@ index 0c56b23..ad763ef 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -605,7 +604,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -601,7 +600,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -71,7 +62,7 @@ index 0c56b23..ad763ef 100644
|
||||
{
|
||||
struct wined3d_device *device = query->device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
@@ -639,8 +638,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -635,8 +634,6 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
|
||||
|
||||
if (flags & WINED3DISSUE_END)
|
||||
query->state = QUERY_SIGNALLED;
|
||||
@ -80,7 +71,7 @@ index 0c56b23..ad763ef 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -669,7 +666,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -665,7 +662,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -89,7 +80,7 @@ index 0c56b23..ad763ef 100644
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -677,8 +674,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
|
||||
@@ -673,8 +670,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
|
||||
query->state = QUERY_BUILDING;
|
||||
if (flags & WINED3DISSUE_END)
|
||||
query->state = QUERY_SIGNALLED;
|
||||
@ -98,7 +89,7 @@ index 0c56b23..ad763ef 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -693,10 +688,9 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
@@ -689,10 +684,9 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -110,7 +101,7 @@ index 0c56b23..ad763ef 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -711,10 +705,9 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -707,10 +701,9 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -123,10 +114,10 @@ index 0c56b23..ad763ef 100644
|
||||
|
||||
static const struct wined3d_query_ops event_query_ops =
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 8d1cf24..2daf93c 100644
|
||||
index a26f176..ef9cead 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2990,7 +2990,7 @@ enum query_state {
|
||||
@@ -3118,7 +3118,7 @@ enum query_state {
|
||||
struct wined3d_query_ops
|
||||
{
|
||||
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
|
||||
|
@ -1,16 +1,16 @@
|
||||
From 3958c674d2d38c1df8a5e1685de057629cc9945d Mon Sep 17 00:00:00 2001
|
||||
From ab6ea7552635df439e3ec00a6305296f92b0b737 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 | 235 +++++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/cs.c | 76 ++++++--------
|
||||
dlls/wined3d/query.c | 223 +++++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/wined3d_private.h | 7 +-
|
||||
3 files changed, 192 insertions(+), 126 deletions(-)
|
||||
3 files changed, 186 insertions(+), 120 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 6c54818..9cda883 100644
|
||||
index 94232db..213943f 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -70,7 +70,6 @@ enum wined3d_cs_op
|
||||
@ -38,7 +38,7 @@ index 6c54818..9cda883 100644
|
||||
static void wined3d_cs_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -1857,8 +1846,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
@@ -1989,8 +1978,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
|
||||
query->query_ops->query_issue(query, op->flags);
|
||||
|
||||
@ -50,7 +50,7 @@ index 6c54818..9cda883 100644
|
||||
|
||||
return sizeof(*op);
|
||||
}
|
||||
@@ -1875,37 +1865,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
@@ -2007,37 +1997,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -88,7 +88,7 @@ index 6c54818..9cda883 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -1954,7 +1913,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2086,7 +2045,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
|
||||
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
@ -96,7 +96,7 @@ index 6c54818..9cda883 100644
|
||||
};
|
||||
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
|
||||
@@ -2073,17 +2031,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
|
||||
@@ -2205,17 +2163,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
|
||||
wined3d_texture_incref(cs->onscreen_depth_stencil->container);
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ index 6c54818..9cda883 100644
|
||||
{
|
||||
continue;
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index fa2c4fc..66368cf 100644
|
||||
index 6b42332..e3e3f56 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -272,7 +272,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
@ -254,7 +254,7 @@ index fa2c4fc..66368cf 100644
|
||||
}
|
||||
|
||||
context = context_acquire(device, context_get_rt_surface(oq->context));
|
||||
@@ -375,67 +398,77 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -375,61 +398,71 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (available)
|
||||
{
|
||||
@ -294,14 +294,8 @@ index fa2c4fc..66368cf 100644
|
||||
|
||||
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
|
||||
-
|
||||
- if (!data || !size) return S_OK;
|
||||
- if (!event_query)
|
||||
- {
|
||||
- WARN("Event query not supported by GL, reporting GPU idle.\n");
|
||||
- signaled = TRUE;
|
||||
- fill_query_data(data, size, &signaled, sizeof(signaled));
|
||||
- if (!data || !size)
|
||||
- return S_OK;
|
||||
- }
|
||||
-
|
||||
ret = wined3d_event_query_test(event_query, query->device);
|
||||
switch(ret)
|
||||
@ -340,19 +334,13 @@ index fa2c4fc..66368cf 100644
|
||||
+static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
+ void *pData, DWORD dwSize, DWORD flags)
|
||||
+{
|
||||
+ struct wined3d_event_query *event_query = query->extendedData;
|
||||
+ BOOL *data = pData;
|
||||
+ enum wined3d_event_query_result ret;
|
||||
+
|
||||
+ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags);
|
||||
+
|
||||
+ if (!pData || !dwSize) return S_OK;
|
||||
+ if (!event_query)
|
||||
+ {
|
||||
+ WARN("Event query not supported by GL, reporting GPU idle.\n");
|
||||
+ *data = TRUE;
|
||||
+ if (!pData || !dwSize)
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ if (!wined3d_settings.cs_multithreaded)
|
||||
+ ret = query->query_ops->query_poll(query);
|
||||
@ -366,7 +354,7 @@ index fa2c4fc..66368cf 100644
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -566,33 +599,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -557,33 +590,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
void *data, DWORD size, DWORD flags)
|
||||
{
|
||||
struct wined3d_timestamp_query *tq = query->extendedData;
|
||||
@ -408,13 +396,13 @@ index fa2c4fc..66368cf 100644
|
||||
GLuint available;
|
||||
GLuint64 timestamp;
|
||||
- HRESULT res;
|
||||
+ BOOL ret;
|
||||
|
||||
-
|
||||
- TRACE("query %p, data %p, size %#x, flags %#x.\n", query, data, size, flags);
|
||||
-
|
||||
- if (!tq->context)
|
||||
- query->state = QUERY_CREATED;
|
||||
-
|
||||
+ BOOL ret;
|
||||
|
||||
- if (query->state == QUERY_CREATED)
|
||||
+ if (!gl_info->supported[ARB_TIMER_QUERY])
|
||||
{
|
||||
@ -439,7 +427,7 @@ index fa2c4fc..66368cf 100644
|
||||
}
|
||||
|
||||
context = context_acquire(device, context_get_rt_surface(tq->context));
|
||||
@@ -603,23 +660,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -594,23 +651,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (available)
|
||||
{
|
||||
@ -470,7 +458,7 @@ index fa2c4fc..66368cf 100644
|
||||
}
|
||||
|
||||
static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
@@ -662,7 +716,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -653,7 +707,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);
|
||||
@ -478,7 +466,7 @@ index fa2c4fc..66368cf 100644
|
||||
if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
|
||||
{
|
||||
static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE};
|
||||
@@ -684,6 +737,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -675,6 +728,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -490,7 +478,7 @@ index fa2c4fc..66368cf 100644
|
||||
static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
@@ -706,6 +764,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
@@ -697,6 +755,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -502,7 +490,7 @@ index fa2c4fc..66368cf 100644
|
||||
static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
FIXME("query %p, flags %#x.\n", query, flags);
|
||||
@@ -723,6 +786,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -714,6 +777,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -514,7 +502,7 @@ index fa2c4fc..66368cf 100644
|
||||
static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
FIXME("query %p, flags %#x.\n", query, flags);
|
||||
@@ -731,36 +799,42 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -722,36 +790,42 @@ 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,
|
||||
@ -557,7 +545,7 @@ index fa2c4fc..66368cf 100644
|
||||
wined3d_overflow_query_ops_issue
|
||||
};
|
||||
|
||||
@@ -875,6 +949,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
@@ -866,6 +940,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
query->state = QUERY_CREATED;
|
||||
query->device = device;
|
||||
query->ref = 1;
|
||||
@ -566,10 +554,10 @@ index fa2c4fc..66368cf 100644
|
||||
return WINED3D_OK;
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 6fc8190..3699e3d 100644
|
||||
index f8d1ed1..a41aad8 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1330,6 +1330,7 @@ struct wined3d_occlusion_query
|
||||
@@ -1374,6 +1374,7 @@ struct wined3d_occlusion_query
|
||||
struct list entry;
|
||||
GLuint id;
|
||||
struct wined3d_context *context;
|
||||
@ -577,7 +565,7 @@ index 6fc8190..3699e3d 100644
|
||||
};
|
||||
|
||||
union wined3d_gl_query_object
|
||||
@@ -1365,6 +1366,7 @@ struct wined3d_timestamp_query
|
||||
@@ -1409,6 +1410,7 @@ struct wined3d_timestamp_query
|
||||
struct list entry;
|
||||
GLuint id;
|
||||
struct wined3d_context *context;
|
||||
@ -585,7 +573,7 @@ index 6fc8190..3699e3d 100644
|
||||
};
|
||||
|
||||
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
|
||||
@@ -2957,6 +2959,7 @@ struct wined3d_cs
|
||||
@@ -3024,6 +3026,7 @@ struct wined3d_cs
|
||||
struct wined3d_cs_queue queue;
|
||||
|
||||
LONG pending_presents;
|
||||
@ -593,7 +581,7 @@ index 6fc8190..3699e3d 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
@@ -3055,6 +3058,7 @@ enum query_state {
|
||||
@@ -3122,6 +3125,7 @@ enum query_state {
|
||||
struct wined3d_query_ops
|
||||
{
|
||||
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
|
||||
@ -601,7 +589,7 @@ index 6fc8190..3699e3d 100644
|
||||
void (*query_issue)(struct wined3d_query *query, DWORD flags);
|
||||
};
|
||||
|
||||
@@ -3070,7 +3074,8 @@ struct wined3d_query
|
||||
@@ -3137,7 +3141,8 @@ struct wined3d_query
|
||||
DWORD data_size;
|
||||
void *extendedData;
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
From 32fc352490121af82ed5cc62c15f6e0ad7357c78 Mon Sep 17 00:00:00 2001
|
||||
From 4ceddc82591a0ba5dd38e15f6f4fd43d1a2752f1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Wed, 24 Jul 2013 17:27:35 +0200
|
||||
Subject: wined3d: Don't poll queries that failed to start
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 5 +++--
|
||||
dlls/wined3d/query.c | 27 +++++++++++++++++++--------
|
||||
dlls/wined3d/query.c | 25 ++++++++++++++++++-------
|
||||
dlls/wined3d/wined3d_private.h | 2 +-
|
||||
3 files changed, 23 insertions(+), 11 deletions(-)
|
||||
3 files changed, 22 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 48d9fe3..540817f 100644
|
||||
index 2f66eff..7178624 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -1820,10 +1820,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
@@ -1984,10 +1984,11 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
{
|
||||
const struct wined3d_cs_query_issue *op = data;
|
||||
struct wined3d_query *query = op->query;
|
||||
@ -28,10 +28,10 @@ index 48d9fe3..540817f 100644
|
||||
list_add_tail(&cs->query_poll_list, &query->poll_list_entry);
|
||||
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index 20b915f..f43a371 100644
|
||||
index f67159e..4c2c318 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -480,7 +480,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
@@ -479,7 +479,7 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
return query->type;
|
||||
}
|
||||
|
||||
@ -40,13 +40,9 @@ index 20b915f..f43a371 100644
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -490,21 +490,24 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla
|
||||
@@ -489,18 +489,21 @@ static void wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD fla
|
||||
struct wined3d_event_query *event_query = query->extendedData;
|
||||
|
||||
/* Faked event query support */
|
||||
- if (!event_query) return;
|
||||
+ if (!event_query) return FALSE;
|
||||
|
||||
wined3d_event_query_issue(event_query, query->device);
|
||||
+ return TRUE;
|
||||
}
|
||||
@ -67,7 +63,7 @@ index 20b915f..f43a371 100644
|
||||
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -570,6 +573,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -566,6 +569,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
}
|
||||
}
|
||||
oq->started = FALSE;
|
||||
@ -75,7 +71,7 @@ index 20b915f..f43a371 100644
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -577,7 +581,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -573,7 +577,7 @@ static void wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
FIXME("%p Occlusion queries not supported.\n", query);
|
||||
}
|
||||
|
||||
@ -84,7 +80,7 @@ index 20b915f..f43a371 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -661,7 +665,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query)
|
||||
@@ -657,7 +661,7 @@ static BOOL wined3d_timestamp_query_ops_poll(struct wined3d_query *query)
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -93,7 +89,7 @@ index 20b915f..f43a371 100644
|
||||
{
|
||||
struct wined3d_device *device = query->device;
|
||||
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
|
||||
@@ -692,6 +696,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -688,6 +692,10 @@ static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
{
|
||||
ERR("Timestamp queries not supported.\n");
|
||||
}
|
||||
@ -104,7 +100,7 @@ index 20b915f..f43a371 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -724,9 +732,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer
|
||||
@@ -720,9 +728,10 @@ static BOOL wined3d_timestamp_disjoint_query_ops_poll(struct wined3d_query *quer
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -116,7 +112,7 @@ index 20b915f..f43a371 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -746,9 +755,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query)
|
||||
@@ -742,9 +751,10 @@ static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -128,7 +124,7 @@ index 20b915f..f43a371 100644
|
||||
}
|
||||
|
||||
static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -768,9 +778,10 @@ static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query)
|
||||
@@ -764,9 +774,10 @@ static BOOL wined3d_overflow_query_ops_poll(struct wined3d_query *query)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -141,10 +137,10 @@ index 20b915f..f43a371 100644
|
||||
|
||||
static const struct wined3d_query_ops event_query_ops =
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 0e5b031..acfbb63 100644
|
||||
index d9d0b63..91b343c 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3003,7 +3003,7 @@ struct wined3d_query_ops
|
||||
@@ -3130,7 +3130,7 @@ struct wined3d_query_ops
|
||||
{
|
||||
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
|
||||
BOOL (*query_poll)(struct wined3d_query *query);
|
||||
|
@ -5187,10 +5187,10 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -397,12 +473,22 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
fill_query_data(data, size, &signaled, sizeof(signaled));
|
||||
@@ -391,12 +467,22 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (!data || !size)
|
||||
return S_OK;
|
||||
}
|
||||
+#else /* STAGING_CSMT */
|
||||
+ return ret;
|
||||
+}
|
||||
@ -5210,7 +5210,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
signaled = TRUE;
|
||||
fill_query_data(data, size, &signaled, sizeof(signaled));
|
||||
break;
|
||||
@@ -411,17 +497,64 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -405,17 +491,58 @@ static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
signaled = FALSE;
|
||||
fill_query_data(data, size, &signaled, sizeof(signaled));
|
||||
break;
|
||||
@ -5248,19 +5248,13 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
+static HRESULT wined3d_event_query_ops_get_data(struct wined3d_query *query,
|
||||
+ void *pData, DWORD dwSize, DWORD flags)
|
||||
+{
|
||||
+ struct wined3d_event_query *event_query = query->extendedData;
|
||||
+ BOOL *data = pData;
|
||||
+ enum wined3d_event_query_result ret;
|
||||
+
|
||||
+ TRACE("query %p, pData %p, dwSize %#x, flags %#x.\n", query, pData, dwSize, flags);
|
||||
+
|
||||
+ if (!pData || !dwSize) return S_OK;
|
||||
+ if (!event_query)
|
||||
+ {
|
||||
+ WARN("Event query not supported by GL, reporting GPU idle.\n");
|
||||
+ *data = TRUE;
|
||||
+ if (!pData || !dwSize)
|
||||
+ return S_OK;
|
||||
+ }
|
||||
+
|
||||
+ if (!wined3d_settings.cs_multithreaded)
|
||||
+ ret = query->query_ops->query_poll(query);
|
||||
@ -5275,7 +5269,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -440,7 +573,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
@@ -434,7 +561,11 @@ enum wined3d_query_type CDECL wined3d_query_get_type(const struct wined3d_query
|
||||
return query->type;
|
||||
}
|
||||
|
||||
@ -5287,18 +5281,11 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -450,15 +587,23 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -444,12 +575,16 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
struct wined3d_event_query *event_query = query->extendedData;
|
||||
|
||||
/* Faked event query support */
|
||||
+#if !defined(STAGING_CSMT)
|
||||
if (!event_query) return WINED3D_OK;
|
||||
|
||||
wined3d_event_query_issue(event_query, query->device);
|
||||
+#else /* STAGING_CSMT */
|
||||
+ if (!event_query) return FALSE;
|
||||
+
|
||||
+ wined3d_event_query_issue(event_query, query->device);
|
||||
+#if defined(STAGING_CSMT)
|
||||
+ return TRUE;
|
||||
+#endif /* STAGING_CSMT */
|
||||
}
|
||||
@ -5311,7 +5298,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
|
||||
if (flags & WINED3DISSUE_BEGIN)
|
||||
query->state = QUERY_BUILDING;
|
||||
@@ -469,9 +614,18 @@ static HRESULT wined3d_event_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -460,9 +595,18 @@ 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)
|
||||
@ -5330,7 +5317,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
|
||||
@@ -483,7 +637,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -474,7 +618,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
/* This is allowed according to msdn and our tests. Reset the query and restart */
|
||||
if (flags & WINED3DISSUE_BEGIN)
|
||||
{
|
||||
@ -5342,7 +5329,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
{
|
||||
if (oq->context->tid != GetCurrentThreadId())
|
||||
{
|
||||
@@ -512,6 +670,9 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -503,6 +651,9 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
checkGLcall("glBeginQuery()");
|
||||
|
||||
context_release(context);
|
||||
@ -5352,7 +5339,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
}
|
||||
if (flags & WINED3DISSUE_END)
|
||||
{
|
||||
@@ -519,7 +680,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -510,7 +661,11 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
* our tests show that it returns OK. But OpenGL doesn't like it, so avoid
|
||||
* generating an error
|
||||
*/
|
||||
@ -5364,7 +5351,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
{
|
||||
if (oq->context->tid != GetCurrentThreadId())
|
||||
{
|
||||
@@ -533,8 +698,15 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -524,8 +679,15 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
checkGLcall("glEndQuery()");
|
||||
|
||||
context_release(context);
|
||||
@ -5380,7 +5367,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -542,23 +714,62 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -533,23 +695,62 @@ static HRESULT wined3d_occlusion_query_ops_issue(struct wined3d_query *query, DW
|
||||
FIXME("%p Occlusion queries not supported.\n", query);
|
||||
}
|
||||
|
||||
@ -5443,7 +5430,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);
|
||||
@@ -573,14 +784,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -564,14 +765,28 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
timestamp = 0;
|
||||
fill_query_data(data, size, ×tamp, sizeof(timestamp));
|
||||
return S_OK;
|
||||
@ -5472,7 +5459,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
}
|
||||
|
||||
context = context_acquire(device, context_get_rt_surface(tq->context));
|
||||
@@ -591,6 +816,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -582,6 +797,7 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (available)
|
||||
{
|
||||
@ -5480,7 +5467,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
if (size)
|
||||
{
|
||||
GL_EXTCALL(glGetQueryObjectui64v(tq->id, GL_QUERY_RESULT, ×tamp));
|
||||
@@ -599,18 +825,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -590,18 +806,36 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
fill_query_data(data, size, ×tamp, sizeof(timestamp));
|
||||
}
|
||||
res = S_OK;
|
||||
@ -5517,7 +5504,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;
|
||||
@@ -643,16 +887,23 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
|
||||
@@ -634,16 +868,23 @@ static HRESULT wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DW
|
||||
}
|
||||
|
||||
if (flags & WINED3DISSUE_END)
|
||||
@ -5541,7 +5528,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};
|
||||
@@ -674,6 +925,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -665,6 +906,7 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -5549,7 +5536,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);
|
||||
@@ -684,6 +936,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
|
||||
@@ -675,6 +917,17 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *
|
||||
query->state = QUERY_SIGNALLED;
|
||||
|
||||
return WINED3D_OK;
|
||||
@ -5567,7 +5554,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,
|
||||
@@ -698,10 +961,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
@@ -689,10 +942,22 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -5590,7 +5577,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,
|
||||
@@ -716,45 +991,75 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -707,45 +972,75 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -5666,7 +5653,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
wined3d_overflow_query_ops_issue
|
||||
};
|
||||
|
||||
@@ -776,13 +1081,20 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
@@ -767,13 +1062,20 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
}
|
||||
query->query_ops = &occlusion_query_ops;
|
||||
query->data_size = sizeof(DWORD);
|
||||
@ -5687,7 +5674,7 @@ diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
break;
|
||||
|
||||
case WINED3D_QUERY_TYPE_EVENT:
|
||||
@@ -869,6 +1181,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
@@ -860,6 +1162,9 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
query->state = QUERY_CREATED;
|
||||
query->device = device;
|
||||
query->ref = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user