You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to implement stub for QUERY_TYPE_PIPELINE_STATISTICS.
This commit is contained in:
@@ -0,0 +1,144 @@
|
||||
From d02a092f2e480b6ca82273de0a50534c5cb7d42f 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.
|
||||
|
||||
---
|
||||
dlls/d3d10core/tests/device.c | 2 +-
|
||||
dlls/d3d11/tests/d3d11.c | 2 +-
|
||||
dlls/wined3d/query.c | 45 +++++++++++++++++++++++++++++++++++++++++++
|
||||
include/wine/wined3d.h | 15 +++++++++++++++
|
||||
4 files changed, 62 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
|
||||
index 6c87a979ba6..be915a8ff86 100644
|
||||
--- a/dlls/d3d10core/tests/device.c
|
||||
+++ b/dlls/d3d10core/tests/device.c
|
||||
@@ -3604,7 +3604,7 @@ static void test_create_query(void)
|
||||
{D3D10_QUERY_OCCLUSION, FALSE, FALSE},
|
||||
{D3D10_QUERY_TIMESTAMP, FALSE, FALSE},
|
||||
{D3D10_QUERY_TIMESTAMP_DISJOINT, FALSE, FALSE},
|
||||
- {D3D10_QUERY_PIPELINE_STATISTICS, FALSE, TRUE},
|
||||
+ {D3D10_QUERY_PIPELINE_STATISTICS, FALSE, FALSE},
|
||||
{D3D10_QUERY_OCCLUSION_PREDICATE, TRUE, FALSE},
|
||||
{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 9d8d827b306..fbbede8dd79 100644
|
||||
--- a/dlls/d3d11/tests/d3d11.c
|
||||
+++ b/dlls/d3d11/tests/d3d11.c
|
||||
@@ -4564,7 +4564,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},
|
||||
- {D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, TRUE},
|
||||
+ {D3D11_QUERY_PIPELINE_STATISTICS, D3D_FEATURE_LEVEL_10_0, FALSE, FALSE, FALSE},
|
||||
{D3D11_QUERY_OCCLUSION_PREDICATE, D3D_FEATURE_LEVEL_10_0, TRUE, TRUE, FALSE},
|
||||
{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 c5ca37d4878..23a07a9e09c 100644
|
||||
--- a/dlls/wined3d/query.c
|
||||
+++ b/dlls/wined3d/query.c
|
||||
@@ -304,6 +304,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);
|
||||
@@ -646,6 +650,18 @@ static void wined3d_overflow_query_ops_issue(struct wined3d_query *query, DWORD
|
||||
FIXME("query %p, flags %#x.\n", query, flags);
|
||||
}
|
||||
|
||||
+static HRESULT wined3d_pipeline_query_ops_poll(struct wined3d_query *query, DWORD flags)
|
||||
+{
|
||||
+ TRACE("query %p, flags %#x.\n", query, flags);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static void wined3d_pipeline_query_ops_issue(struct wined3d_query *query, DWORD flags)
|
||||
+{
|
||||
+ FIXME("query %p, flags %#x.\n", query, flags);
|
||||
+}
|
||||
+
|
||||
static const struct wined3d_query_ops event_query_ops =
|
||||
{
|
||||
wined3d_event_query_ops_poll,
|
||||
@@ -838,6 +854,32 @@ static HRESULT wined3d_overflow_query_create(struct wined3d_device *device,
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
+static const struct wined3d_query_ops pipeline_query_ops =
|
||||
+{
|
||||
+ wined3d_pipeline_query_ops_poll,
|
||||
+ wined3d_pipeline_query_ops_issue,
|
||||
+};
|
||||
+
|
||||
+static HRESULT wined3d_pipeline_query_create(struct wined3d_device *device,
|
||||
+ enum wined3d_query_type type, void *parent, struct wined3d_query **query)
|
||||
+{
|
||||
+ static const struct wined3d_query_data_pipeline_statistics data;
|
||||
+ struct wined3d_query *object;
|
||||
+
|
||||
+ FIXME("device %p, type %#x, parent %p, query %p.\n", device, type, parent, query);
|
||||
+
|
||||
+ if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
|
||||
+ return E_OUTOFMEMORY;
|
||||
+
|
||||
+ wined3d_query_init(object, device, type, &data,
|
||||
+ sizeof(data), &pipeline_query_ops, parent);
|
||||
+
|
||||
+ TRACE("Created query %p.\n", object);
|
||||
+ *query = object;
|
||||
+
|
||||
+ return WINED3D_OK;
|
||||
+}
|
||||
+
|
||||
HRESULT CDECL wined3d_query_create(struct wined3d_device *device,
|
||||
enum wined3d_query_type type, void *parent, struct wined3d_query **query)
|
||||
{
|
||||
@@ -864,6 +906,9 @@ HRESULT CDECL wined3d_query_create(struct wined3d_device *device,
|
||||
case WINED3D_QUERY_TYPE_SO_OVERFLOW:
|
||||
return wined3d_overflow_query_create(device, type, parent, query);
|
||||
|
||||
+ case WINED3D_QUERY_TYPE_PIPELINE_STATISTICS:
|
||||
+ return wined3d_pipeline_query_create(device, type, parent, query);
|
||||
+
|
||||
default:
|
||||
FIXME("Unhandled query type %#x.\n", type);
|
||||
return WINED3DERR_NOTAVAILABLE;
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index 0357bfda6d8..2625cf5a879 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -711,6 +711,21 @@ struct wined3d_query_data_so_statistics
|
||||
UINT64 needed;
|
||||
};
|
||||
|
||||
+struct wined3d_query_data_pipeline_statistics
|
||||
+{
|
||||
+ UINT64 ia_vertices;
|
||||
+ UINT64 ia_primitives;
|
||||
+ UINT64 vs_invocations;
|
||||
+ UINT64 gs_invocations;
|
||||
+ UINT64 gs_primitives;
|
||||
+ UINT64 c_invocations;
|
||||
+ UINT64 c_primitives;
|
||||
+ UINT64 ps_invocations;
|
||||
+ UINT64 hs_invocations;
|
||||
+ UINT64 ds_invocations;
|
||||
+ UINT64 cs_invocations;
|
||||
+};
|
||||
+
|
||||
#define WINED3DISSUE_BEGIN (1u << 1)
|
||||
#define WINED3DISSUE_END (1u << 0)
|
||||
#define WINED3DGETDATA_FLUSH (1u << 0)
|
||||
--
|
||||
2.11.0
|
||||
|
@@ -1 +1,2 @@
|
||||
Fixes: [20776] Add stubs for QUERY_TYPE_SO_STATISTICS and QUERY_TYPE_SO_OVERFLOW
|
||||
Fixes: Add stub for QUERY_TYPE_PIPELINE_STATISTICS
|
||||
|
Reference in New Issue
Block a user