mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2024-09-13 09:17:20 -07:00
Rebase against 38fb1062daaf68afe4dc20e1aceddfa89fe1ea4f.
This commit is contained in:
parent
4f12cf4dc9
commit
08dca3b834
@ -51,7 +51,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "9ba058e94c2662f5296c95adeafd29c59b137249"
|
||||
echo "38fb1062daaf68afe4dc20e1aceddfa89fe1ea4f"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
|
@ -1,19 +1,19 @@
|
||||
From 61128d9c27790e748b376a5f5ba9070e13a0d0fa Mon Sep 17 00:00:00 2001
|
||||
From 3958c674d2d38c1df8a5e1685de057629cc9945d 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 | 233 +++++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/cs.c | 76 ++++++-------
|
||||
dlls/wined3d/query.c | 235 +++++++++++++++++++++++++++--------------
|
||||
dlls/wined3d/wined3d_private.h | 7 +-
|
||||
3 files changed, 190 insertions(+), 126 deletions(-)
|
||||
3 files changed, 192 insertions(+), 126 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 2bcabbf..d721534 100644
|
||||
index 6c54818..9cda883 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -69,7 +69,6 @@ enum wined3d_cs_op
|
||||
@@ -70,7 +70,6 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_MAP,
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
@ -21,7 +21,7 @@ index 2bcabbf..d721534 100644
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -384,16 +383,6 @@ struct wined3d_cs_query_issue
|
||||
@@ -397,16 +396,6 @@ struct wined3d_cs_query_issue
|
||||
DWORD flags;
|
||||
};
|
||||
|
||||
@ -38,7 +38,7 @@ index 2bcabbf..d721534 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);
|
||||
@@ -1818,8 +1807,9 @@ static UINT wined3d_cs_exec_query_issue(struct wined3d_cs *cs, const void *data)
|
||||
@@ -1857,8 +1846,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 2bcabbf..d721534 100644
|
||||
|
||||
return sizeof(*op);
|
||||
}
|
||||
@@ -1836,37 +1826,6 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
@@ -1875,37 +1865,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 2bcabbf..d721534 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -1914,7 +1873,6 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -1954,7 +1913,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 2bcabbf..d721534 100644
|
||||
};
|
||||
|
||||
static void *wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size)
|
||||
@@ -2033,17 +1991,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
|
||||
@@ -2073,17 +2031,45 @@ void wined3d_cs_switch_onscreen_ds(struct wined3d_cs *cs,
|
||||
wined3d_texture_incref(cs->onscreen_depth_stencil->container);
|
||||
}
|
||||
|
||||
@ -143,13 +143,14 @@ index 2bcabbf..d721534 100644
|
||||
{
|
||||
continue;
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index 84d3340..64a8672 100644
|
||||
index fa2c4fc..66368cf 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -241,6 +241,15 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
@@ -272,7 +272,18 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
TRACE("%p decreasing refcount to %u.\n", query, refcount);
|
||||
|
||||
if (!refcount)
|
||||
{
|
||||
+ {
|
||||
+ if (wined3d_settings.cs_multithreaded)
|
||||
+ {
|
||||
+ struct wined3d_device *device = query->device;
|
||||
@ -159,10 +160,12 @@ index 84d3340..64a8672 100644
|
||||
+ device->cs->ops->finish(device->cs);
|
||||
+ }
|
||||
+
|
||||
/* 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
|
||||
@@ -275,20 +284,10 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
wined3d_cs_emit_destroy_object(query->device->cs, wined3d_query_destroy_object, query);
|
||||
+ }
|
||||
|
||||
return refcount;
|
||||
}
|
||||
@@ -280,20 +291,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)
|
||||
{
|
||||
@ -184,7 +187,7 @@ index 84d3340..64a8672 100644
|
||||
}
|
||||
|
||||
UINT CDECL wined3d_query_get_data_size(const struct wined3d_query *query)
|
||||
@@ -317,15 +316,10 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result
|
||||
@@ -322,15 +323,10 @@ static void fill_query_data(void *out, unsigned int out_size, const void *result
|
||||
static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
void *data, DWORD size, DWORD flags)
|
||||
{
|
||||
@ -201,7 +204,7 @@ index 84d3340..64a8672 100644
|
||||
|
||||
if (!oq->context)
|
||||
query->state = QUERY_CREATED;
|
||||
@@ -339,6 +333,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -344,6 +340,8 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -210,7 +213,7 @@ index 84d3340..64a8672 100644
|
||||
if (query->state == QUERY_BUILDING)
|
||||
{
|
||||
/* Msdn says this returns an error, but our tests show that S_FALSE is returned */
|
||||
@@ -354,12 +350,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -359,12 +357,37 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -251,7 +254,7 @@ index 84d3340..64a8672 100644
|
||||
}
|
||||
|
||||
context = context_acquire(device, context_get_rt_surface(oq->context));
|
||||
@@ -370,67 +391,77 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -375,67 +398,77 @@ static HRESULT wined3d_occlusion_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (available)
|
||||
{
|
||||
@ -363,7 +366,7 @@ index 84d3340..64a8672 100644
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -561,33 +592,57 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -566,33 +599,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;
|
||||
@ -436,7 +439,7 @@ index 84d3340..64a8672 100644
|
||||
}
|
||||
|
||||
context = context_acquire(device, context_get_rt_surface(tq->context));
|
||||
@@ -598,23 +653,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -603,23 +660,20 @@ static HRESULT wined3d_timestamp_query_ops_get_data(struct wined3d_query *query,
|
||||
|
||||
if (available)
|
||||
{
|
||||
@ -467,7 +470,7 @@ index 84d3340..64a8672 100644
|
||||
}
|
||||
|
||||
static void wined3d_timestamp_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
@@ -657,7 +709,6 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -662,7 +716,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);
|
||||
@ -475,7 +478,7 @@ index 84d3340..64a8672 100644
|
||||
if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT)
|
||||
{
|
||||
static const struct wined3d_query_data_timestamp_disjoint disjoint_data = {1000 * 1000 * 1000, FALSE};
|
||||
@@ -679,6 +730,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
@@ -684,6 +737,11 @@ static HRESULT wined3d_timestamp_disjoint_query_ops_get_data(struct wined3d_quer
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -487,7 +490,7 @@ index 84d3340..64a8672 100644
|
||||
static void wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
TRACE("query %p, flags %#x.\n", query, flags);
|
||||
@@ -701,6 +757,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
@@ -706,6 +764,11 @@ static HRESULT wined3d_statistics_query_ops_get_data(struct wined3d_query *query
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -499,7 +502,7 @@ index 84d3340..64a8672 100644
|
||||
static void wined3d_statistics_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
FIXME("query %p, flags %#x.\n", query, flags);
|
||||
@@ -718,6 +779,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
@@ -723,6 +786,11 @@ static HRESULT wined3d_overflow_query_ops_get_data(struct wined3d_query *query,
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@ -511,7 +514,7 @@ index 84d3340..64a8672 100644
|
||||
static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
{
|
||||
FIXME("query %p, flags %#x.\n", query, flags);
|
||||
@@ -726,36 +792,42 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
@@ -731,36 +799,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,
|
||||
@ -554,7 +557,7 @@ index 84d3340..64a8672 100644
|
||||
wined3d_overflow_query_ops_issue
|
||||
};
|
||||
|
||||
@@ -870,6 +942,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
@@ -875,6 +949,7 @@ static HRESULT query_init(struct wined3d_query *query, struct wined3d_device *de
|
||||
query->state = QUERY_CREATED;
|
||||
query->device = device;
|
||||
query->ref = 1;
|
||||
@ -563,10 +566,10 @@ index 84d3340..64a8672 100644
|
||||
return WINED3D_OK;
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 3c10eb6..1d85e1b 100644
|
||||
index 6fc8190..3699e3d 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -1277,6 +1277,7 @@ struct wined3d_occlusion_query
|
||||
@@ -1330,6 +1330,7 @@ struct wined3d_occlusion_query
|
||||
struct list entry;
|
||||
GLuint id;
|
||||
struct wined3d_context *context;
|
||||
@ -574,7 +577,7 @@ index 3c10eb6..1d85e1b 100644
|
||||
};
|
||||
|
||||
union wined3d_gl_query_object
|
||||
@@ -1312,6 +1313,7 @@ struct wined3d_timestamp_query
|
||||
@@ -1365,6 +1366,7 @@ struct wined3d_timestamp_query
|
||||
struct list entry;
|
||||
GLuint id;
|
||||
struct wined3d_context *context;
|
||||
@ -582,7 +585,7 @@ index 3c10eb6..1d85e1b 100644
|
||||
};
|
||||
|
||||
void context_alloc_timestamp_query(struct wined3d_context *context, struct wined3d_timestamp_query *query) DECLSPEC_HIDDEN;
|
||||
@@ -2898,6 +2900,7 @@ struct wined3d_cs
|
||||
@@ -2957,6 +2959,7 @@ struct wined3d_cs
|
||||
struct wined3d_cs_queue queue;
|
||||
|
||||
LONG pending_presents;
|
||||
@ -590,7 +593,7 @@ index 3c10eb6..1d85e1b 100644
|
||||
};
|
||||
|
||||
struct wined3d_cs *wined3d_cs_create(struct wined3d_device *device) DECLSPEC_HIDDEN;
|
||||
@@ -2994,6 +2997,7 @@ enum query_state {
|
||||
@@ -3055,6 +3058,7 @@ enum query_state {
|
||||
struct wined3d_query_ops
|
||||
{
|
||||
HRESULT (*query_get_data)(struct wined3d_query *query, void *data, DWORD data_size, DWORD flags);
|
||||
@ -598,7 +601,7 @@ index 3c10eb6..1d85e1b 100644
|
||||
void (*query_issue)(struct wined3d_query *query, DWORD flags);
|
||||
};
|
||||
|
||||
@@ -3009,7 +3013,8 @@ struct wined3d_query
|
||||
@@ -3070,7 +3074,8 @@ struct wined3d_query
|
||||
DWORD data_size;
|
||||
void *extendedData;
|
||||
|
||||
|
@ -1,183 +1,45 @@
|
||||
From 6285debb172f28036f6f970edb0180adff28ec55 Mon Sep 17 00:00:00 2001
|
||||
From 817d317d346d6f91b7affb58ed533ba3c22a397d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 6 Jul 2013 21:54:45 +0200
|
||||
Subject: wined3d: Destroy queries through the CS
|
||||
|
||||
---
|
||||
dlls/wined3d/cs.c | 31 ++++++++++++++++++++
|
||||
dlls/wined3d/query.c | 66 +++++++++++++++++++-----------------------
|
||||
dlls/wined3d/wined3d_private.h | 3 ++
|
||||
3 files changed, 64 insertions(+), 36 deletions(-)
|
||||
dlls/wined3d/query.c | 14 +++-----------
|
||||
1 file changed, 3 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 03ad89d..48d9fe3 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -69,6 +69,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_MAP,
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
+ WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -383,6 +384,12 @@ struct wined3d_cs_query_issue
|
||||
DWORD flags;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_query_destroy
|
||||
+{
|
||||
+ enum wined3d_cs_op opcode;
|
||||
+ struct wined3d_query *query;
|
||||
+};
|
||||
+
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -1835,6 +1842,29 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
+static UINT wined3d_cs_exec_query_destroy(struct wined3d_cs *cs, const void *data)
|
||||
+{
|
||||
+ const struct wined3d_cs_query_destroy *op = data;
|
||||
+
|
||||
+ if (!list_empty(&op->query->poll_list_entry))
|
||||
+ list_remove(&op->query->poll_list_entry);
|
||||
+
|
||||
+ wined3d_query_destroy(op->query);
|
||||
+
|
||||
+ return sizeof(*op);
|
||||
+}
|
||||
+
|
||||
+void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query)
|
||||
+{
|
||||
+ struct wined3d_cs_query_destroy *op;
|
||||
+
|
||||
+ op = cs->ops->require_space(cs, sizeof(*op));
|
||||
+ op->opcode = WINED3D_CS_OP_QUERY_DESTROY;
|
||||
+ op->query = query;
|
||||
+
|
||||
+ cs->ops->submit(cs, sizeof(*op));
|
||||
+}
|
||||
+
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -1882,6 +1912,7 @@ 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,
|
||||
+ /* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
};
|
||||
|
||||
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
|
||||
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
|
||||
index 6c981af..eaff776 100644
|
||||
index 66368cf..c1ba517 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -233,50 +233,44 @@ ULONG CDECL wined3d_query_incref(struct wined3d_query *query)
|
||||
return refcount;
|
||||
}
|
||||
|
||||
-ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
+void wined3d_query_destroy(struct wined3d_query *query)
|
||||
@@ -237,6 +237,9 @@ static void wined3d_query_destroy_object(void *object)
|
||||
{
|
||||
- ULONG refcount = InterlockedDecrement(&query->ref);
|
||||
-
|
||||
- TRACE("%p decreasing refcount to %u.\n", query, refcount);
|
||||
+ /* 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
|
||||
+ * context, and (still) leaking the actual query. */
|
||||
+ if (query->type == WINED3D_QUERY_TYPE_EVENT)
|
||||
+ {
|
||||
+ struct wined3d_event_query *event_query = query->extendedData;
|
||||
+ if (event_query) wined3d_event_query_destroy(event_query);
|
||||
+ }
|
||||
+ else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION)
|
||||
+ {
|
||||
+ struct wined3d_occlusion_query *oq = query->extendedData;
|
||||
struct wined3d_query *query = object;
|
||||
|
||||
- if (!refcount)
|
||||
+ if (oq->context) context_free_occlusion_query(oq);
|
||||
+ HeapFree(GetProcessHeap(), 0, query->extendedData);
|
||||
+ }
|
||||
+ else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP)
|
||||
{
|
||||
+ if (!list_empty(&query->poll_list_entry))
|
||||
+ list_remove(&query->poll_list_entry);
|
||||
+
|
||||
/* 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
|
||||
@@ -272,18 +275,7 @@ ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
TRACE("%p decreasing refcount to %u.\n", query, refcount);
|
||||
|
||||
if (!refcount)
|
||||
- {
|
||||
- if (wined3d_settings.cs_multithreaded)
|
||||
- {
|
||||
- struct wined3d_device *device = query->device;
|
||||
+ struct wined3d_timestamp_query *tq = query->extendedData;
|
||||
|
||||
-
|
||||
- FIXME("waiting for cs\n");
|
||||
- wined3d_cs_emit_glfinish(device->cs);
|
||||
- device->cs->ops->finish(device->cs);
|
||||
- }
|
||||
+ if (tq->context)
|
||||
+ context_free_timestamp_query(tq);
|
||||
+ HeapFree(GetProcessHeap(), 0, query->extendedData);
|
||||
+ }
|
||||
|
||||
- /* 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
|
||||
- * context, and (still) leaking the actual query. */
|
||||
- if (query->type == WINED3D_QUERY_TYPE_EVENT)
|
||||
- {
|
||||
- struct wined3d_event_query *event_query = query->extendedData;
|
||||
- if (event_query) wined3d_event_query_destroy(event_query);
|
||||
- }
|
||||
- else if (query->type == WINED3D_QUERY_TYPE_OCCLUSION)
|
||||
- {
|
||||
- struct wined3d_occlusion_query *oq = query->extendedData;
|
||||
+ HeapFree(GetProcessHeap(), 0, query);
|
||||
+}
|
||||
|
||||
- if (oq->context) context_free_occlusion_query(oq);
|
||||
- HeapFree(GetProcessHeap(), 0, query->extendedData);
|
||||
- }
|
||||
- else if (query->type == WINED3D_QUERY_TYPE_TIMESTAMP)
|
||||
- {
|
||||
- struct wined3d_timestamp_query *tq = query->extendedData;
|
||||
+ULONG CDECL wined3d_query_decref(struct wined3d_query *query)
|
||||
+{
|
||||
+ ULONG refcount = InterlockedDecrement(&query->ref);
|
||||
|
||||
- if (tq->context)
|
||||
- context_free_timestamp_query(tq);
|
||||
- HeapFree(GetProcessHeap(), 0, query->extendedData);
|
||||
- }
|
||||
+ TRACE("%p decreasing refcount to %u.\n", query, refcount);
|
||||
|
||||
- HeapFree(GetProcessHeap(), 0, query);
|
||||
-
|
||||
wined3d_cs_emit_destroy_object(query->device->cs, wined3d_query_destroy_object, query);
|
||||
- }
|
||||
+ if (!refcount)
|
||||
+ wined3d_cs_emit_query_destroy(query->device->cs, query);
|
||||
|
||||
return refcount;
|
||||
}
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 9efcd14..7651b39 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2986,6 +2986,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
DWORD flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data,
|
||||
UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Direct3D terminology with little modifications. We do not have an issued state
|
||||
* because only the driver knows about it, but we have a created state because d3d
|
||||
@@ -3020,6 +3021,8 @@ struct wined3d_query
|
||||
struct list poll_list_entry;
|
||||
};
|
||||
|
||||
+void wined3d_query_destroy(struct wined3d_query *query) DECLSPEC_HIDDEN;
|
||||
+
|
||||
/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
|
||||
* fixed function semantics as D3DCOLOR or FLOAT16 */
|
||||
enum wined3d_buffer_conversion_type
|
||||
--
|
||||
2.8.0
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
From bcfd12bb0bafeba3d720f3448c222688243cc672 Mon Sep 17 00:00:00 2001
|
||||
From c4394ed6817eddd3c0ca2c516173ddc84638ec7c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 1 Aug 2013 00:10:40 +0200
|
||||
Subject: wined3d: Send texture preloads through the CS
|
||||
@ -10,19 +10,19 @@ Subject: wined3d: Send texture preloads through the CS
|
||||
3 files changed, 35 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index afb1a80..f0d9834 100644
|
||||
index f8d7928..66c2f62 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -70,6 +70,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_MAP,
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
+ WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -390,6 +391,12 @@ struct wined3d_cs_query_destroy
|
||||
struct wined3d_query *query;
|
||||
@@ -396,6 +397,12 @@ struct wined3d_cs_query_issue
|
||||
DWORD flags;
|
||||
};
|
||||
|
||||
+struct wined3d_cs_texture_preload
|
||||
@ -34,7 +34,7 @@ index afb1a80..f0d9834 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -1889,6 +1896,30 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *
|
||||
@@ -1898,6 +1905,30 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -65,19 +65,19 @@ index afb1a80..f0d9834 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -1937,6 +1968,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -1946,6 +1977,7 @@ 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,
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
+ /* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
};
|
||||
|
||||
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
|
||||
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
|
||||
index 14ac300..fac20c9 100644
|
||||
index e220474..094d707 100644
|
||||
--- a/dlls/wined3d/texture.c
|
||||
+++ b/dlls/wined3d/texture.c
|
||||
@@ -819,10 +819,8 @@ void wined3d_texture_load(struct wined3d_texture *texture,
|
||||
@@ -894,10 +894,8 @@ void wined3d_texture_load(struct wined3d_texture *texture,
|
||||
|
||||
void CDECL wined3d_texture_preload(struct wined3d_texture *texture)
|
||||
{
|
||||
@ -91,13 +91,13 @@ index 14ac300..fac20c9 100644
|
||||
|
||||
void * CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 545c180..34e258a 100644
|
||||
index c468a7f..eedaccc 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2988,6 +2988,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
@@ -3048,6 +3048,7 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
DWORD flags) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data,
|
||||
UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
|
||||
/* Direct3D terminology with little modifications. We do not have an issued state
|
||||
|
@ -1,4 +1,4 @@
|
||||
From d4219aaabd252d45506c391898326af17c1d1417 Mon Sep 17 00:00:00 2001
|
||||
From 59ad07b3a1737ba2cb291ceb967840ed999e63ba Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Thu, 1 Aug 2013 00:33:48 +0200
|
||||
Subject: wined3d: Send update_texture calls through the CS
|
||||
@ -11,18 +11,18 @@ FIXME: This logic duplication is ugly.
|
||||
3 files changed, 137 insertions(+), 82 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index d65f27a..9a4aec1 100644
|
||||
index 66c2f62..39f6978 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -71,6 +71,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
+ WINED3D_CS_OP_UPDATE_TEXTURE,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -402,6 +403,12 @@ struct wined3d_cs_texture_preload
|
||||
@@ -403,6 +404,12 @@ struct wined3d_cs_texture_preload
|
||||
struct wined3d_texture *texture;
|
||||
};
|
||||
|
||||
@ -35,7 +35,7 @@ index d65f27a..9a4aec1 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -1919,6 +1926,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
|
||||
@@ -1929,6 +1936,31 @@ void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_textu
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -67,9 +67,9 @@ index d65f27a..9a4aec1 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -1968,6 +2000,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -1978,6 +2010,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
+ /* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
|
||||
};
|
||||
@ -319,10 +319,10 @@ index 903b091..6dc0a25 100644
|
||||
|
||||
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, DWORD *num_passes)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 4eb0689..9519e5d 100644
|
||||
index 25f1ec9..769a970 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2421,6 +2421,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
|
||||
@@ -2435,6 +2435,8 @@ void device_resource_add(struct wined3d_device *device, struct wined3d_resource
|
||||
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
|
||||
void device_invalidate_state(const struct wined3d_device *device, DWORD state) DECLSPEC_HIDDEN;
|
||||
void device_invalidate_shader_constants(const struct wined3d_device *device, DWORD mask) DECLSPEC_HIDDEN;
|
||||
@ -331,9 +331,9 @@ index 4eb0689..9519e5d 100644
|
||||
|
||||
static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
|
||||
{
|
||||
@@ -3034,6 +3036,8 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query
|
||||
@@ -3049,6 +3051,8 @@ void wined3d_cs_emit_query_issue(struct wined3d_cs *cs, struct wined3d_query *qu
|
||||
void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query *query, void *data,
|
||||
UINT data_size, DWORD flags, HRESULT *ret) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *query) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
+void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
|
||||
+ struct wined3d_texture *dst) DECLSPEC_HIDDEN;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 4cd31abbb46ce2584a71b523edfc0c057a13359e Mon Sep 17 00:00:00 2001
|
||||
From 81ddb7588fa1f7dde51cfffea7c95287bd9e933b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Tue, 6 Aug 2013 13:50:31 +0200
|
||||
Subject: wined3d: Handle evit_managed_resources through the CS
|
||||
@ -10,18 +10,18 @@ Subject: wined3d: Handle evit_managed_resources through the CS
|
||||
3 files changed, 41 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 0ef6d4b..e036b3e 100644
|
||||
index 39f6978..f33cfa8 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -72,6 +72,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
WINED3D_CS_OP_UPDATE_TEXTURE,
|
||||
+ WINED3D_CS_OP_EVICT_RESOURCE,
|
||||
WINED3D_CS_OP_STOP,
|
||||
};
|
||||
|
||||
@@ -404,6 +405,12 @@ struct wined3d_cs_update_texture
|
||||
@@ -410,6 +411,12 @@ struct wined3d_cs_update_texture
|
||||
struct wined3d_texture *src, *dst;
|
||||
};
|
||||
|
||||
@ -34,7 +34,7 @@ index 0ef6d4b..e036b3e 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -1952,6 +1959,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
|
||||
@@ -1961,6 +1968,35 @@ void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_textur
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -70,8 +70,8 @@ index 0ef6d4b..e036b3e 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2002,6 +2038,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
@@ -2011,6 +2047,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
|
||||
+ /* WINED3D_CS_OP_EVICT_RESOURCE */ wined3d_cs_exec_evict_resource,
|
||||
@ -79,10 +79,10 @@ index 0ef6d4b..e036b3e 100644
|
||||
|
||||
static inline void *_wined3d_cs_mt_require_space(struct wined3d_cs *cs, size_t size, BOOL prio)
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 12e87e1..8dbefcf 100644
|
||||
index 6c274c8..eed3623 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -4499,13 +4499,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
|
||||
@@ -4540,13 +4540,8 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
|
||||
|
||||
TRACE("device %p.\n", device);
|
||||
|
||||
@ -98,7 +98,7 @@ index 12e87e1..8dbefcf 100644
|
||||
LIST_FOR_EACH_ENTRY_SAFE(resource, cursor, &device->resources, struct wined3d_resource, resource_list_entry)
|
||||
{
|
||||
TRACE("Checking resource %p for eviction.\n", resource);
|
||||
@@ -4513,12 +4508,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
|
||||
@@ -4554,12 +4549,9 @@ void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
|
||||
if (resource->pool == WINED3D_POOL_MANAGED && !resource->map_count)
|
||||
{
|
||||
TRACE("Evicting %p.\n", resource);
|
||||
@ -113,10 +113,10 @@ index 12e87e1..8dbefcf 100644
|
||||
|
||||
static void delete_opengl_contexts(struct wined3d_device *device, struct wined3d_swapchain *swapchain)
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index a6ff922..38a72de 100644
|
||||
index 769a970..8d991e1 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -2993,6 +2993,7 @@ void wined3d_cs_emit_query_destroy(struct wined3d_cs *cs, struct wined3d_query *
|
||||
@@ -3053,6 +3053,7 @@ void wined3d_cs_emit_query_get_data(struct wined3d_cs *cs, struct wined3d_query
|
||||
void wined3d_cs_emit_texture_preload(struct wined3d_cs *cs, struct wined3d_texture *texture) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_update_texture(struct wined3d_cs *cs, struct wined3d_texture *src,
|
||||
struct wined3d_texture *dst) DECLSPEC_HIDDEN;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From f842a9a07432ce0bea63b5a4017da38bdac8f46a Mon Sep 17 00:00:00 2001
|
||||
From f39c194da347f4bece34f7bea45b6c53461818c0 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 6 Jul 2013 16:14:16 +0200
|
||||
Subject: wined3d: Accelerate DISCARD buffer maps
|
||||
@ -13,10 +13,10 @@ TODO3: Clean up the map_mem allocation mess.
|
||||
3 files changed, 51 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 3d9cb5c..c1d5a40 100644
|
||||
index 9b21e97..5c5c1da 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -1064,10 +1064,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -1055,10 +1055,19 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
buffer->flags |= WINED3D_BUFFER_SYNC;
|
||||
}
|
||||
|
||||
@ -40,18 +40,18 @@ index 3d9cb5c..c1d5a40 100644
|
||||
|
||||
base = buffer->map_ptr ? buffer->map_ptr : buffer->resource.map_heap_memory;
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 3a6299a..16d16e5 100644
|
||||
index 640a5f8..cabb880 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -69,6 +69,7 @@ enum wined3d_cs_op
|
||||
@@ -70,6 +70,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_CHANGED,
|
||||
WINED3D_CS_OP_TEXTURE_MAP,
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
+ WINED3D_CS_OP_BUFFER_SWAP_MEM,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
@@ -385,6 +386,13 @@ struct wined3d_cs_texture_changed
|
||||
WINED3D_CS_OP_UPDATE_TEXTURE,
|
||||
@@ -397,6 +398,13 @@ struct wined3d_cs_texture_changed
|
||||
void *swap_heap_memory;
|
||||
};
|
||||
|
||||
@ -65,7 +65,7 @@ index 3a6299a..16d16e5 100644
|
||||
struct wined3d_cs_skip
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
@@ -2233,6 +2241,34 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -2242,6 +2250,34 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
cs->ops->finish(cs);
|
||||
}
|
||||
|
||||
@ -100,19 +100,19 @@ index 3a6299a..16d16e5 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2280,6 +2316,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2290,6 +2326,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_TEXTURE_CHANGED */ wined3d_cs_exec_texture_changed,
|
||||
/* WINED3D_CS_OP_TEXTURE_MAP */ wined3d_cs_exec_texture_map,
|
||||
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
|
||||
+ /* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 5feee06..c7b7e8f 100644
|
||||
index bb87b41..a6d438a 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3033,6 +3033,8 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour
|
||||
@@ -3093,6 +3093,8 @@ void wined3d_cs_emit_evict_resource(struct wined3d_cs *cs, struct wined3d_resour
|
||||
void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_resource *resource,
|
||||
unsigned int sub_resource_idx, const struct wined3d_box *box, const void *data, unsigned int row_pitch,
|
||||
unsigned int depth_pitch) DECLSPEC_HIDDEN;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 477daa94578dd929f9682f56a6ac807ac0b9041b Mon Sep 17 00:00:00 2001
|
||||
From 1250ebaa61f449f123ea6677416ea876cc3cb0b2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sat, 6 Jul 2013 17:05:12 +0200
|
||||
Subject: wined3d: Access the buffer dirty areas through the CS
|
||||
@ -27,7 +27,7 @@ be protected by locks.
|
||||
3 files changed, 37 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index e4ee1ba..ca2184e 100644
|
||||
index 3a7ceeb..e51a87e 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -41,7 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
@ -39,7 +39,7 @@ index e4ee1ba..ca2184e 100644
|
||||
{
|
||||
if (!offset && (!size || size == buffer->resource.size))
|
||||
goto invalidate_all;
|
||||
@@ -987,9 +987,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
@@ -978,9 +978,9 @@ HRESULT CDECL wined3d_buffer_map(struct wined3d_buffer *buffer, UINT offset, UIN
|
||||
* being uploaded in that case. Two such applications are Port Royale
|
||||
* and Darkstar One. */
|
||||
if (flags & WINED3D_MAP_DISCARD)
|
||||
@ -52,18 +52,18 @@ index e4ee1ba..ca2184e 100644
|
||||
if (!(buffer->flags & WINED3D_BUFFER_DOUBLEBUFFER))
|
||||
{
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index 16d16e5..b530ab2 100644
|
||||
index cabb880..2fa9077 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -70,6 +70,7 @@ enum wined3d_cs_op
|
||||
@@ -71,6 +71,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_MAP,
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_BUFFER_SWAP_MEM,
|
||||
+ WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
@@ -393,6 +394,13 @@ struct wined3d_cs_buffer_swap_mem
|
||||
WINED3D_CS_OP_UPDATE_TEXTURE,
|
||||
@@ -405,6 +406,13 @@ struct wined3d_cs_buffer_swap_mem
|
||||
BYTE *mem;
|
||||
};
|
||||
|
||||
@ -77,7 +77,7 @@ index 16d16e5..b530ab2 100644
|
||||
struct wined3d_cs_skip
|
||||
{
|
||||
enum wined3d_cs_op opcode;
|
||||
@@ -2269,6 +2277,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
|
||||
@@ -2278,6 +2286,28 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -106,19 +106,19 @@ index 16d16e5..b530ab2 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2317,6 +2347,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2327,6 +2357,7 @@ 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_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
|
||||
+ /* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index c7b7e8f..18693e3 100644
|
||||
index a6d438a..97537a7 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3035,6 +3035,8 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
@@ -3095,6 +3095,8 @@ void wined3d_cs_emit_update_sub_resource(struct wined3d_cs *cs, struct wined3d_r
|
||||
unsigned int depth_pitch) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffer *buffer,
|
||||
BYTE *mem) DECLSPEC_HIDDEN;
|
||||
@ -127,7 +127,7 @@ index c7b7e8f..18693e3 100644
|
||||
|
||||
/* Direct3D terminology with little modifications. We do not have an issued state
|
||||
* because only the driver knows about it, but we have a created state because d3d
|
||||
@@ -3124,6 +3126,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
|
||||
@@ -3182,6 +3184,7 @@ HRESULT wined3d_buffer_copy(struct wined3d_buffer *dst_buffer, unsigned int dst_
|
||||
struct wined3d_buffer *src_buffer, unsigned int src_offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
HRESULT wined3d_buffer_upload_data(struct wined3d_buffer *buffer,
|
||||
const struct wined3d_box *box, const void *data) DECLSPEC_HIDDEN;
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 2230e8a2635b98e710facae0c430711ad70f3a0c Mon Sep 17 00:00:00 2001
|
||||
From bddfb1096b5a073ab49a5daedecf8e7fb31d5804 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
|
||||
Date: Sun, 7 Jul 2013 12:02:59 +0200
|
||||
Subject: wined3d: Send buffer preloads through the CS
|
||||
@ -13,10 +13,10 @@ the dirty area list, have to be considered.
|
||||
3 files changed, 33 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c
|
||||
index 3fb0d7c..4a73dcb 100644
|
||||
index e652695..92f3833 100644
|
||||
--- a/dlls/wined3d/buffer.c
|
||||
+++ b/dlls/wined3d/buffer.c
|
||||
@@ -934,7 +934,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
|
||||
@@ -925,7 +925,6 @@ void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_conte
|
||||
|
||||
void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
|
||||
{
|
||||
@ -24,7 +24,7 @@ index 3fb0d7c..4a73dcb 100644
|
||||
struct wined3d_device *device = buffer->resource.device;
|
||||
|
||||
if (buffer->resource.map_count)
|
||||
@@ -943,16 +942,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
|
||||
@@ -934,16 +933,7 @@ void CDECL wined3d_buffer_preload(struct wined3d_buffer *buffer)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -43,18 +43,18 @@ index 3fb0d7c..4a73dcb 100644
|
||||
|
||||
struct wined3d_resource * CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
|
||||
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c
|
||||
index b530ab2..91e4a84 100644
|
||||
index 2fa9077..6b409d8 100644
|
||||
--- a/dlls/wined3d/cs.c
|
||||
+++ b/dlls/wined3d/cs.c
|
||||
@@ -71,6 +71,7 @@ enum wined3d_cs_op
|
||||
@@ -72,6 +72,7 @@ enum wined3d_cs_op
|
||||
WINED3D_CS_OP_TEXTURE_UNMAP,
|
||||
WINED3D_CS_OP_BUFFER_SWAP_MEM,
|
||||
WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE,
|
||||
+ WINED3D_CS_OP_BUFFER_PRELOAD,
|
||||
WINED3D_CS_OP_QUERY_ISSUE,
|
||||
WINED3D_CS_OP_QUERY_DESTROY,
|
||||
WINED3D_CS_OP_TEXTURE_PRELOAD,
|
||||
@@ -447,6 +448,12 @@ struct wined3d_cs_update_sub_resource
|
||||
WINED3D_CS_OP_UPDATE_TEXTURE,
|
||||
@@ -453,6 +454,12 @@ struct wined3d_cs_update_sub_resource
|
||||
const void *data;
|
||||
};
|
||||
|
||||
@ -67,7 +67,7 @@ index b530ab2..91e4a84 100644
|
||||
static void wined3d_cs_mt_submit(struct wined3d_cs *cs, size_t size)
|
||||
{
|
||||
LONG new_val = (cs->queue.head + size) & (WINED3D_CS_QUEUE_SIZE - 1);
|
||||
@@ -2299,6 +2306,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
@@ -2308,6 +2315,29 @@ void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
cs->ops->submit(cs, sizeof(*op));
|
||||
}
|
||||
|
||||
@ -97,19 +97,19 @@ index b530ab2..91e4a84 100644
|
||||
static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void *data) =
|
||||
{
|
||||
/* WINED3D_CS_OP_NOP */ wined3d_cs_exec_nop,
|
||||
@@ -2348,6 +2378,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
@@ -2358,6 +2388,7 @@ static UINT (* const wined3d_cs_op_handlers[])(struct wined3d_cs *cs, const void
|
||||
/* WINED3D_CS_OP_TEXTURE_UNMAP */ wined3d_cs_exec_texture_unmap,
|
||||
/* WINED3D_CS_OP_BUFFER_SWAP_MEM */ wined3d_cs_exec_buffer_swap_mem,
|
||||
/* WINED3D_CS_OP_BUFFER_INVALIDATE_RANGE */ wined3d_cs_exec_buffer_invalidate_bo_range,
|
||||
+ /* WINED3D_CS_OP_BUFFER_PRELOAD */ wined3d_cs_exec_buffer_preload,
|
||||
/* WINED3D_CS_OP_QUERY_ISSUE */ wined3d_cs_exec_query_issue,
|
||||
/* WINED3D_CS_OP_QUERY_DESTROY */ wined3d_cs_exec_query_destroy,
|
||||
/* WINED3D_CS_OP_TEXTURE_PRELOAD */ wined3d_cs_exec_texture_preload,
|
||||
/* WINED3D_CS_OP_UPDATE_TEXTURE */ wined3d_cs_exec_update_texture,
|
||||
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
|
||||
index 18693e3..dcaab57 100644
|
||||
index 97537a7..0a9b962 100644
|
||||
--- a/dlls/wined3d/wined3d_private.h
|
||||
+++ b/dlls/wined3d/wined3d_private.h
|
||||
@@ -3037,6 +3037,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
|
||||
@@ -3097,6 +3097,7 @@ void wined3d_cs_emit_buffer_swap_mem(struct wined3d_cs *cs, struct wined3d_buffe
|
||||
BYTE *mem) DECLSPEC_HIDDEN;
|
||||
void wined3d_cs_emit_buffer_invalidate_bo_range(struct wined3d_cs *cs,
|
||||
struct wined3d_buffer *buffer, unsigned int offset, unsigned int size) DECLSPEC_HIDDEN;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user