Rebase against 06eceb3af2d56f158dab2db5a7bc768cc2b1c391.

This commit is contained in:
Sebastian Lackner
2017-05-31 07:06:29 +02:00
parent 907f73aa4b
commit ac2c2ffdb8
15 changed files with 105 additions and 393 deletions

View File

@@ -1,14 +1,14 @@
From 3354f6b38cd1b3a18a4c81ec430d0557f3503290 Mon Sep 17 00:00:00 2001
From e673885709da5bb4d6e13bb9c005ef590768e198 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 | 96 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 100 insertions(+), 4 deletions(-)
dlls/d3d10core/tests/device.c | 4 +-
dlls/d3d11/tests/d3d11.c | 4 +-
dlls/wined3d/query.c | 100 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 104 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 364a2abfe7f..c08004723cc 100644
@@ -26,7 +26,7 @@ index 364a2abfe7f..c08004723cc 100644
ULONG refcount, expected_refcount;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 431db44e1cc..18d2a2fd4d1 100644
index b160977caec..a56bcd91f70 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4600,8 +4600,8 @@ static void test_create_query(void)
@@ -41,25 +41,10 @@ index 431db44e1cc..18d2a2fd4d1 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, FALSE},
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 28db6be239b..53745f959e6 100644
index 55871130ce0..3c7a3ae4f8a 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -309,6 +309,14 @@ static void wined3d_query_destroy_object(void *object)
context_free_so_statistics_query(pq);
HeapFree(GetProcessHeap(), 0, pq);
}
+ 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);
@@ -773,6 +781,34 @@ static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, D
@@ -729,6 +729,34 @@ static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, D
return poll;
}
@@ -91,17 +76,23 @@ index 28db6be239b..53745f959e6 100644
+ return FALSE;
+}
+
static const struct wined3d_query_ops event_query_ops =
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
{
wined3d_event_query_ops_poll,
@@ -979,6 +1015,60 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
struct wined3d_event_query *event_query = wined3d_event_query_from_query(query);
@@ -981,6 +1009,72 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
+static void wined3d_statistics_query_ops_destroy(struct wined3d_query *query)
+{
+ HeapFree(GetProcessHeap(), 0, query);
+}
+
+static const struct wined3d_query_ops statistics_query_ops =
+{
+ wined3d_statistics_query_ops_poll,
+ wined3d_statistics_query_ops_issue,
+ wined3d_statistics_query_ops_destroy,
+};
+
+static HRESULT wined3d_statistics_query_create(struct wined3d_device *device,
@@ -125,10 +116,16 @@ index 28db6be239b..53745f959e6 100644
+ return WINED3D_OK;
+}
+
+static void wined3d_overflow_query_ops_destroy(struct wined3d_query *query)
+{
+ HeapFree(GetProcessHeap(), 0, query);
+}
+
+static const struct wined3d_query_ops overflow_query_ops =
+{
+ wined3d_overflow_query_ops_poll,
+ wined3d_overflow_query_ops_issue,
+ wined3d_overflow_query_ops_destroy,
+};
+
+static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
@@ -155,7 +152,7 @@ index 28db6be239b..53745f959e6 100644
HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
{
@@ -1006,6 +1096,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
@@ -1008,6 +1102,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_SO_STATISTICS_STREAM3:
return wined3d_so_statistics_query_create(device, type, parent, parent_ops, query);

View File

@@ -1,4 +1,4 @@
From 47db3c24a1b6504146154b31fc285a54578dc3ad Mon Sep 17 00:00:00 2001
From 6313efefb1d2dc0adaaae123cee74678e0709fee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 22 Jan 2017 01:51:51 +0100
Subject: d3d11: Add dummy support for D3D11_QUERY_PIPELINE_STATISTICS query.
@@ -6,9 +6,9 @@ Subject: d3d11: Add dummy support for D3D11_QUERY_PIPELINE_STATISTICS query.
---
dlls/d3d10core/tests/device.c | 2 +-
dlls/d3d11/tests/d3d11.c | 2 +-
dlls/wined3d/query.c | 48 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 15 ++++++++++++++
4 files changed, 65 insertions(+), 2 deletions(-)
dlls/wined3d/query.c | 50 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 15 +++++++++++++
4 files changed, 67 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index c08004723cc..9958feb1c25 100644
@@ -24,7 +24,7 @@ index c08004723cc..9958feb1c25 100644
{D3D10_QUERY_SO_STATISTICS, FALSE, FALSE},
{D3D10_QUERY_SO_OVERFLOW_PREDICATE, TRUE, FALSE},
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 18d2a2fd4d1..91620723f46 100644
index a56bcd91f70..9c4b0392014 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4598,7 +4598,7 @@ static void test_create_query(void)
@@ -37,21 +37,10 @@ index 18d2a2fd4d1..91620723f46 100644
{D3D11_QUERY_SO_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_SO_OVERFLOW_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 53745f959e6..db747362ab5 100644
index 3c7a3ae4f8a..1da1b3ea7ae 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -317,6 +317,10 @@ static void wined3d_query_destroy_object(void *object)
{
HeapFree(GetProcessHeap(), 0, query);
}
+ else if (query->type == WINED3D_QUERY_TYPE_PIPELINE_STATISTICS)
+ {
+ HeapFree(GetProcessHeap(), 0, query);
+ }
else
{
ERR("Query %p has invalid type %#x.\n", query, query->type);
@@ -809,6 +813,20 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
@@ -757,6 +757,20 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
return FALSE;
}
@@ -69,17 +58,23 @@ index 53745f959e6..db747362ab5 100644
+ return FALSE;
+}
+
static const struct wined3d_query_ops event_query_ops =
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
{
wined3d_event_query_ops_poll,
@@ -1069,6 +1087,33 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
struct wined3d_event_query *event_query = wined3d_event_query_from_query(query);
@@ -1075,6 +1089,39 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
+static void wined3d_pipeline_query_ops_destroy(struct wined3d_query *query)
+{
+ HeapFree(GetProcessHeap(), 0, query);
+}
+
+static const struct wined3d_query_ops pipeline_query_ops =
+{
+ wined3d_pipeline_query_ops_poll,
+ wined3d_pipeline_query_ops_issue,
+ wined3d_pipeline_query_ops_destroy,
+};
+
+static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
@@ -106,7 +101,7 @@ index 53745f959e6..db747362ab5 100644
HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_query_type type,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
{
@@ -1102,6 +1147,9 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
@@ -1108,6 +1155,9 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_SO_OVERFLOW:
return wined3d_overflow_query_create(device, type, parent, parent_ops, query);

View File

@@ -1,24 +0,0 @@
From d9ca35b4d4489e101caa4950d086413a3a08a0e7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 28 May 2017 03:59:24 +0200
Subject: wined3d: Don't leak free_so_statistics_queries on device destruction.
---
dlls/wined3d/context.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index bdcdf007a42..8d674c1cf88 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -1343,6 +1343,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
checkGLcall("context cleanup");
}
+ HeapFree(GetProcessHeap(), 0, context->free_so_statistics_queries);
HeapFree(GetProcessHeap(), 0, context->free_timestamp_queries);
HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, context->free_event_queries);
--
2.12.2

View File

@@ -1,4 +1,4 @@
From f38e263c61ba7273b01fa0f9e82680e08f089d35 Mon Sep 17 00:00:00 2001
From a36cd6cf41376b8dae38c289d353da26ecf53ee3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 28 May 2017 04:49:57 +0200
Subject: wined3d: Implement WINED3D_QUERY_TYPE_PIPELINE_STATISTICS.
@@ -6,16 +6,16 @@ Subject: wined3d: Implement WINED3D_QUERY_TYPE_PIPELINE_STATISTICS.
---
dlls/wined3d/context.c | 58 ++++++++++++
dlls/wined3d/directx.c | 1 +
dlls/wined3d/query.c | 196 +++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/query.c | 197 +++++++++++++++++++++++++++++++++++++++--
dlls/wined3d/wined3d_gl.h | 1 +
dlls/wined3d/wined3d_private.h | 39 ++++++++
5 files changed, 286 insertions(+), 9 deletions(-)
5 files changed, 287 insertions(+), 9 deletions(-)
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8d674c1cf88..68c173344b0 100644
index 8ab0e10d815..b03287f5029 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -940,6 +940,43 @@ void context_free_so_statistics_query(struct wined3d_so_statistics_query *query)
@@ -933,6 +933,43 @@ void context_free_so_statistics_query(struct wined3d_so_statistics_query *query)
context->free_so_statistics_queries[context->free_so_statistics_query_count++] = query->u;
}
@@ -59,7 +59,7 @@ index 8d674c1cf88..68c173344b0 100644
typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry);
static void context_enum_fbo_entries(const struct wined3d_device *device,
@@ -1232,6 +1269,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
@@ -1225,6 +1262,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
{
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_so_statistics_query *so_statistics_query;
@@ -67,7 +67,7 @@ index 8d674c1cf88..68c173344b0 100644
struct wined3d_timestamp_query *timestamp_query;
struct wined3d_occlusion_query *occlusion_query;
struct wined3d_event_query *event_query;
@@ -1256,6 +1294,14 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
@@ -1249,6 +1287,14 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
so_statistics_query->context = NULL;
}
@@ -82,7 +82,7 @@ index 8d674c1cf88..68c173344b0 100644
LIST_FOR_EACH_ENTRY(timestamp_query, &context->timestamp_queries, struct wined3d_timestamp_query, entry)
{
if (context->valid)
@@ -1312,6 +1358,15 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
@@ -1305,6 +1351,15 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
}
}
@@ -98,7 +98,7 @@ index 8d674c1cf88..68c173344b0 100644
if (gl_info->supported[ARB_TIMER_QUERY])
GL_EXTCALL(glDeleteQueries(context->free_timestamp_query_count, context->free_timestamp_queries));
@@ -1344,6 +1399,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
@@ -1337,6 +1392,7 @@ static void context_destroy_gl_resources(struct wined3d_context *context)
}
HeapFree(GetProcessHeap(), 0, context->free_so_statistics_queries);
@@ -106,7 +106,7 @@ index 8d674c1cf88..68c173344b0 100644
HeapFree(GetProcessHeap(), 0, context->free_timestamp_queries);
HeapFree(GetProcessHeap(), 0, context->free_occlusion_queries);
HeapFree(GetProcessHeap(), 0, context->free_event_queries);
@@ -1812,6 +1868,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
@@ -1801,6 +1857,8 @@ struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
list_init(&ret->so_statistics_queries);
@@ -116,7 +116,7 @@ index 8d674c1cf88..68c173344b0 100644
list_init(&ret->fbo_destroy_list);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 7a7fbe0578a..ee43cfac449 100644
index e6cefbd2cf2..ec53192b76f 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -144,6 +144,7 @@ static const struct wined3d_extension_map gl_extension_map[] =
@@ -128,7 +128,7 @@ index 7a7fbe0578a..ee43cfac449 100644
{"GL_ARB_point_parameters", ARB_POINT_PARAMETERS },
{"GL_ARB_point_sprite", ARB_POINT_SPRITE },
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index db747362ab5..bbeab020c27 100644
index 1da1b3ea7ae..3bac4e1d28f 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -61,6 +61,11 @@ static struct wined3d_so_statistics_query *wined3d_so_statistics_query_from_quer
@@ -143,17 +143,7 @@ index db747362ab5..bbeab020c27 100644
BOOL wined3d_event_query_supported(const struct wined3d_gl_info *gl_info)
{
return gl_info->supported[ARB_SYNC] || gl_info->supported[NV_FENCE] || gl_info->supported[APPLE_FENCE];
@@ -319,6 +324,9 @@ static void wined3d_query_destroy_object(void *object)
}
else if (query->type == WINED3D_QUERY_TYPE_PIPELINE_STATISTICS)
{
+ struct wined3d_pipeline_statistics_query *pq = wined3d_pipeline_statistics_query_from_query(query);
+ if (pq->context)
+ context_free_pipeline_statistics_query(pq);
HeapFree(GetProcessHeap(), 0, query);
}
else
@@ -815,16 +823,179 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
@@ -759,16 +764,179 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
static BOOL wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD flags)
{
@@ -335,8 +325,19 @@ index db747362ab5..bbeab020c27 100644
+ return poll;
}
static const struct wined3d_query_ops event_query_ops =
@@ -1097,19 +1268,26 @@ static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
static void wined3d_event_query_ops_destroy(struct wined3d_query *query)
@@ -1091,6 +1259,10 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
static void wined3d_pipeline_query_ops_destroy(struct wined3d_query *query)
{
+ struct wined3d_pipeline_statistics_query *pq = wined3d_pipeline_statistics_query_from_query(query);
+
+ if (pq->context)
+ context_free_pipeline_statistics_query(pq);
HeapFree(GetProcessHeap(), 0, query);
}
@@ -1105,19 +1277,26 @@ static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
enum wined3d_query_type type, void *parent, const struct wined3d_parent_ops *parent_ops,
struct wined3d_query **query)
{
@@ -370,7 +371,7 @@ index db747362ab5..bbeab020c27 100644
return WINED3D_OK;
}
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index fc4c1bb11f8..80fc6809238 100644
index 3806869fd42..8b25220cd4b 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -78,6 +78,7 @@ enum wined3d_gl_extension
@@ -382,7 +383,7 @@ index fc4c1bb11f8..80fc6809238 100644
ARB_POINT_PARAMETERS,
ARB_POINT_SPRITE,
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 183c856e07c..315e89d098b 100644
index 18109850157..1025c98f180 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1721,6 +1721,40 @@ void context_alloc_so_statistics_query(struct wined3d_context *context,