1 /*
2 * Copyright 2011 Joakim Sindholt <[email protected]>
3 * SPDX-License-Identifier: MIT
4 */
5
6 #ifndef _NINE_QUERY9_H_
7 #define _NINE_QUERY9_H_
8
9 #include "iunknown.h"
10
11 enum nine_query_state
12 {
13 NINE_QUERY_STATE_FRESH = 0,
14 NINE_QUERY_STATE_RUNNING,
15 NINE_QUERY_STATE_ENDED,
16 };
17
18 struct NineQuery9
19 {
20 struct NineUnknown base;
21 struct pipe_query *pq;
22 DWORD result_size;
23 D3DQUERYTYPE type;
24 enum nine_query_state state;
25 bool instant; /* true if D3DISSUE_BEGIN is not needed / invalid */
26 unsigned counter; /* Number of pending Begin/End (0 if internal multithreading off) */
27 };
28 static inline struct NineQuery9 *
NineQuery9(void * data)29 NineQuery9( void *data )
30 {
31 return (struct NineQuery9 *)data;
32 }
33
34 HRESULT
35 nine_is_query_supported(struct pipe_screen *screen, D3DQUERYTYPE);
36
37 HRESULT
38 NineQuery9_new( struct NineDevice9 *Device,
39 struct NineQuery9 **ppOut,
40 D3DQUERYTYPE);
41
42 HRESULT
43 NineQuery9_ctor( struct NineQuery9 *,
44 struct NineUnknownParams *pParams,
45 D3DQUERYTYPE Type );
46
47 void
48 NineQuery9_dtor( struct NineQuery9 * );
49
50 D3DQUERYTYPE NINE_WINAPI
51 NineQuery9_GetType( struct NineQuery9 *This );
52
53 DWORD NINE_WINAPI
54 NineQuery9_GetDataSize( struct NineQuery9 *This );
55
56 HRESULT NINE_WINAPI
57 NineQuery9_Issue( struct NineQuery9 *This,
58 DWORD dwIssueFlags );
59
60 HRESULT NINE_WINAPI
61 NineQuery9_GetData( struct NineQuery9 *This,
62 void *pData,
63 DWORD dwSize,
64 DWORD dwGetDataFlags );
65
66 #endif /* _NINE_QUERY9_H_ */
67