Henri Verbeet : wined3d: Implement timestamp disjoint queries for the Vulkan adapter.
Alexandre Julliard
julliard at winehq.org
Tue May 26 17:17:07 CDT 2020
Module: wine
Branch: master
Commit: 23ad2662c3a23b1a1ddb406a11ad84bb7f6f9d4a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=23ad2662c3a23b1a1ddb406a11ad84bb7f6f9d4a
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Tue May 26 20:58:13 2020 +0430
wined3d: Implement timestamp disjoint queries for the Vulkan adapter.
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/query.c | 40 +++++++++++++++++++++++++++++++++++++---
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/query.c b/dlls/wined3d/query.c
index 3b6f442f4a..69fc5e7474 100644
--- a/dlls/wined3d/query.c
+++ b/dlls/wined3d/query.c
@@ -1660,12 +1660,21 @@ static const struct wined3d_query_ops wined3d_query_timestamp_vk_ops =
.query_destroy = wined3d_query_vk_destroy,
};
+static const struct wined3d_query_ops wined3d_query_timestamp_disjoint_vk_ops =
+{
+ .query_poll = wined3d_timestamp_disjoint_query_ops_poll,
+ .query_issue = wined3d_timestamp_disjoint_query_ops_issue,
+ .query_destroy = wined3d_query_vk_destroy,
+};
+
HRESULT wined3d_query_vk_create(struct wined3d_device *device, enum wined3d_query_type type,
void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_query **query)
{
+ struct wined3d_query_data_timestamp_disjoint *disjoint_data;
const struct wined3d_query_ops *ops = &wined3d_query_vk_ops;
struct wined3d_query_vk *query_vk;
unsigned int data_size;
+ void *data;
TRACE("device %p, type %#x, parent %p, parent_ops %p, query %p.\n",
device, type, parent, parent_ops, query);
@@ -1686,6 +1695,16 @@ HRESULT wined3d_query_vk_create(struct wined3d_device *device, enum wined3d_quer
data_size = sizeof(uint64_t);
break;
+ case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT:
+ if (!wined3d_device_vk(device)->timestamp_bits)
+ {
+ WARN("Timestamp queries not supported.\n");
+ return WINED3DERR_NOTAVAILABLE;
+ }
+ ops = &wined3d_query_timestamp_disjoint_vk_ops;
+ data_size = sizeof(struct wined3d_query_data_timestamp_disjoint);
+ break;
+
default:
FIXME("Unhandled query type %#x.\n", type);
return WINED3DERR_NOTAVAILABLE;
@@ -1693,11 +1712,26 @@ HRESULT wined3d_query_vk_create(struct wined3d_device *device, enum wined3d_quer
if (!(query_vk = heap_alloc_zero(sizeof(*query_vk) + data_size)))
return E_OUTOFMEMORY;
+ data = query_vk + 1;
- wined3d_query_init(&query_vk->q, device, type, query_vk + 1, data_size, ops, parent, parent_ops);
+ wined3d_query_init(&query_vk->q, device, type, data, data_size, ops, parent, parent_ops);
list_init(&query_vk->entry);
- if (type == WINED3D_QUERY_TYPE_OCCLUSION)
- query_vk->control_flags = VK_QUERY_CONTROL_PRECISE_BIT;
+
+ switch (type)
+ {
+ case WINED3D_QUERY_TYPE_OCCLUSION:
+ query_vk->control_flags = VK_QUERY_CONTROL_PRECISE_BIT;
+ break;
+
+ case WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT:
+ disjoint_data = data;
+ disjoint_data->frequency = 1000000000 / wined3d_adapter_vk(device->adapter)->device_limits.timestampPeriod;
+ disjoint_data->disjoint = FALSE;
+ break;
+
+ default:
+ break;
+ }
TRACE("Created query %p.\n", query_vk);
*query = &query_vk->q;
More information about the wine-cvs
mailing list