Rebase against 799230c78ab102fa0034cb4477ce1be78c456a87.

This commit is contained in:
Sebastian Lackner
2017-05-26 04:26:33 +02:00
parent 0a60add605
commit 857e9c1cd4
7 changed files with 79 additions and 140 deletions

View File

@@ -1,4 +1,4 @@
From 9083e580904536e28ba4cfb3adb65bd24a94ed9d Mon Sep 17 00:00:00 2001
From 3354f6b38cd1b3a18a4c81ec430d0557f3503290 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
@@ -7,16 +7,14 @@ Subject: wined3d: Add stubs for QUERY_TYPE_SO_STATISTICS and
---
dlls/d3d10core/tests/device.c | 4 +-
dlls/d3d11/tests/d3d11.c | 4 +-
dlls/d3d9/device.c | 3 ++
dlls/wined3d/query.c | 96 +++++++++++++++++++++++++++++++++++++++++++
include/wine/wined3d.h | 6 +++
5 files changed, 109 insertions(+), 4 deletions(-)
3 files changed, 100 insertions(+), 4 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 6abc79a7a44..a68baa6d0ff 100644
index 364a2abfe7f..c08004723cc 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -3808,8 +3808,8 @@ static void test_create_query(void)
@@ -3826,8 +3826,8 @@ static void test_create_query(void)
{D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE},
{D3D10_QUERY_PIPELINE_STATISTICS, FALSE, TRUE},
{D3D10_QUERY_OCCLUSION_PREDICATE, TRUE, FALSE},
@@ -28,10 +26,10 @@ index 6abc79a7a44..a68baa6d0ff 100644
ULONG refcount, expected_refcount;
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 91d5927acb1..d409c8beeaa 100644
index 431db44e1cc..18d2a2fd4d1 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4583,8 +4583,8 @@ static void test_create_query(void)
@@ -4600,8 +4600,8 @@ static void test_create_query(void)
{D3D11_QUERY_TIMESTAMP_DISJOINT, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
{D3D11_QUERY_OCCLUSION_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
@@ -39,30 +37,16 @@ index 91d5927acb1..d409c8beeaa 100644
- {D3D11_QUERY_SO_OVERFLOW_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, TRUE},
+ {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},
{D3D11_QUERY_SO_STATISTICS_STREAM0, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, TRUE},
{D3D11_QUERY_SO_STATISTICS_STREAM0, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_SO_OVERFLOW_PREDICATE_STREAM0, D3D_FEATURE_LEVEL_11_0, TRUE, FALSE, TRUE},
{D3D11_QUERY_SO_STATISTICS_STREAM1, D3D_FEATURE_LEVEL_11_0, FALSE, FALSE, TRUE},
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index b4cb25316c7..74273926ae6 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -3445,6 +3445,9 @@ static HRESULT WINAPI d3d9_device_CreateQuery(IDirect3DDevice9Ex *iface, D3DQUER
TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
+ if (type < D3DQUERYTYPE_VCACHE || type > D3DQUERYTYPE_MEMORYPRESSURE)
+ return D3DERR_NOTAVAILABLE;
+
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
return E_OUTOFMEMORY;
{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 3cfbd8431ac..2bca60e7d4c 100644
index 28db6be239b..53745f959e6 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -294,6 +294,14 @@ static void wined3d_query_destroy_object(void *object)
{
HeapFree(GetProcessHeap(), 0, query);
@@ -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)
+ {
@@ -75,8 +59,8 @@ index 3cfbd8431ac..2bca60e7d4c 100644
else
{
ERR("Query %p has invalid type %#x.\n", query, query->type);
@@ -637,6 +645,34 @@ static BOOL wined3d_timestamp_disjoint_query_ops_issue(struct wined3d_query *que
return FALSE;
@@ -773,6 +781,34 @@ static BOOL wined3d_so_statistics_query_ops_issue(struct wined3d_query *query, D
return poll;
}
+static BOOL wined3d_statistics_query_ops_poll(struct wined3d_query *query, DWORD flags)
@@ -110,7 +94,7 @@ index 3cfbd8431ac..2bca60e7d4c 100644
static const struct wined3d_query_ops event_query_ops =
{
wined3d_event_query_ops_poll,
@@ -785,6 +821,60 @@ static HRESULT wined3d_timestamp_disjoint_query_create(struct wined3d_device *de
@@ -979,6 +1015,60 @@ static HRESULT wined3d_so_statistics_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
@@ -171,9 +155,9 @@ index 3cfbd8431ac..2bca60e7d4c 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)
{
@@ -806,6 +896,12 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
case WINED3D_QUERY_TYPE_TIMESTAMP_FREQ:
return wined3d_timestamp_disjoint_query_create(device, type, parent, parent_ops, query);
@@ -1006,6 +1096,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);
+ case WINED3D_QUERY_TYPE_SO_STATISTICS:
+ return wined3d_statistics_query_create(device, type, parent, parent_ops, query);
@@ -184,23 +168,6 @@ index 3cfbd8431ac..2bca60e7d4c 100644
default:
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 97947e44d9c..fc1a5fea56d 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -710,6 +710,12 @@ struct wined3d_query_data_timestamp_disjoint
BOOL disjoint;
};
+struct wined3d_query_data_so_statistics
+{
+ UINT64 written;
+ UINT64 needed;
+};
+
#define WINED3DISSUE_BEGIN (1u << 1)
#define WINED3DISSUE_END (1u << 0)
#define WINED3DGETDATA_FLUSH (1u << 0)
--
2.12.2

View File

@@ -1,4 +1,4 @@
From 74ddf016c63387ed5bf4e94ee96ac82803747f4c Mon Sep 17 00:00:00 2001
From 47db3c24a1b6504146154b31fc285a54578dc3ad 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.
@@ -11,10 +11,10 @@ Subject: d3d11: Add dummy support for D3D11_QUERY_PIPELINE_STATISTICS query.
4 files changed, 65 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index c1b74718b5..957d7b5422 100644
index c08004723cc..9958feb1c25 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -3867,7 +3867,7 @@ static void test_create_query(void)
@@ -3824,7 +3824,7 @@ static void test_create_query(void)
{D3D10_QUERY_OCCLUSION, FALSE, FALSE},
{D3D10_QUERY_TIMESTAMP, FALSE, FALSE},
{D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE},
@@ -24,10 +24,10 @@ index c1b74718b5..957d7b5422 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 ee38b26e00..23bd1eba00 100644
index 18d2a2fd4d1..91620723f46 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -4586,7 +4586,7 @@ static void test_create_query(void)
@@ -4598,7 +4598,7 @@ static void test_create_query(void)
{D3D11_QUERY_OCCLUSION, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_TIMESTAMP, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
{D3D11_QUERY_TIMESTAMP_DISJOINT, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
@@ -37,10 +37,10 @@ index ee38b26e00..23bd1eba00 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 2bca60e7d4..3f9191b486 100644
index 53745f959e6..db747362ab5 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -302,6 +302,10 @@ static void wined3d_query_destroy_object(void *object)
@@ -317,6 +317,10 @@ static void wined3d_query_destroy_object(void *object)
{
HeapFree(GetProcessHeap(), 0, query);
}
@@ -51,7 +51,7 @@ index 2bca60e7d4..3f9191b486 100644
else
{
ERR("Query %p has invalid type %#x.\n", query, query->type);
@@ -673,6 +677,20 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
@@ -809,6 +813,20 @@ static BOOL wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
return FALSE;
}
@@ -72,7 +72,7 @@ index 2bca60e7d4..3f9191b486 100644
static const struct wined3d_query_ops event_query_ops =
{
wined3d_event_query_ops_poll,
@@ -875,6 +893,33 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
@@ -1069,6 +1087,33 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
return WINED3D_OK;
}
@@ -106,7 +106,7 @@ index 2bca60e7d4..3f9191b486 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)
{
@@ -902,6 +947,9 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device, enum wined3d_q
@@ -1102,6 +1147,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);
@@ -117,11 +117,11 @@ index 2bca60e7d4..3f9191b486 100644
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 993797d877..b314ed9427 100644
index 8697fbfa935..b81bc437efe 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -715,6 +715,21 @@ struct wined3d_query_data_so_statistics
UINT64 needed;
@@ -725,6 +725,21 @@ struct wined3d_query_data_so_statistics
UINT64 primitives_generated;
};
+struct wined3d_query_data_pipeline_statistics