2 * Copyright © 2008 Maciej Cencora <m.cencora@gmail.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 * Maciej Cencora <m.cencora@gmail.com>
28 #include "util/simple_list.h"
29 #include "radeon_common_context.h"
31 extern void radeonEmitQueryBegin(struct gl_context
*ctx
);
32 extern void radeonEmitQueryEnd(struct gl_context
*ctx
);
34 extern void radeonInitQueryObjFunctions(struct dd_function_table
*functions
);
36 #define RADEON_QUERY_PAGE_SIZE 4096
38 int radeon_check_query_active(struct gl_context
*ctx
, struct radeon_state_atom
*atom
);
39 void radeon_emit_queryobj(struct gl_context
*ctx
, struct radeon_state_atom
*atom
);
41 static inline void radeon_init_query_stateobj(radeonContextPtr radeon
, int SZ
)
43 radeon
->query
.queryobj
.cmd_size
= (SZ
);
44 radeon
->query
.queryobj
.cmd
= calloc(SZ
, sizeof(uint32_t));
45 radeon
->query
.queryobj
.name
= "queryobj";
46 radeon
->query
.queryobj
.idx
= 0;
47 radeon
->query
.queryobj
.check
= radeon_check_query_active
;
48 radeon
->query
.queryobj
.dirty
= GL_FALSE
;
49 radeon
->query
.queryobj
.emit
= radeon_emit_queryobj
;
51 radeon
->hw
.max_state_size
+= (SZ
);
52 insert_at_tail(&radeon
->hw
.atomlist
, &radeon
->query
.queryobj
);