blob: 41e21d302ca84556bf637948d4a5016e296e76c5 [file] [log] [blame]
Chia-I Wue18ff1b2014-08-07 13:38:51 +08001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef QUERY_H
26#define QUERY_H
27
28#include "intel.h"
29#include "obj.h"
30
31struct intel_query {
32 struct intel_obj obj;
33
34 XGL_QUERY_TYPE type;
35 XGL_UINT slot_stride;
36 XGL_UINT slot_count;
37};
38
39static inline struct intel_query *intel_query(XGL_QUERY_POOL pool)
40{
41 return (struct intel_query *) pool;
42}
43
44static inline struct intel_query *intel_query_from_base(struct intel_base *base)
45{
46 return (struct intel_query *) base;
47}
48
49static inline struct intel_query *intel_query_from_obj(struct intel_obj *obj)
50{
51 return intel_query_from_base(&obj->base);
52}
53
54XGL_RESULT intel_query_create(struct intel_dev *dev,
55 const XGL_QUERY_POOL_CREATE_INFO *info,
56 struct intel_query **query_ret);
57void intel_query_destroy(struct intel_query *query);
58
59XGL_RESULT intel_query_get_results(struct intel_query *query,
60 XGL_UINT slot_start, XGL_UINT slot_count,
61 void *results);
62
63XGL_RESULT XGLAPI intelCreateQueryPool(
64 XGL_DEVICE device,
65 const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo,
66 XGL_QUERY_POOL* pQueryPool);
67
68XGL_RESULT XGLAPI intelGetQueryPoolResults(
69 XGL_QUERY_POOL queryPool,
70 XGL_UINT startQuery,
71 XGL_UINT queryCount,
72 XGL_SIZE* pDataSize,
73 XGL_VOID* pData);
74
75#endif /* QUERY_H */