1 /**************************************************************************
3 * Copyright 2011 The Chromium OS authors.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL GOOGLE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 /* Fake occlusion queries which return 0, it's better than crashing */
30 #include "pipe/p_compiler.h"
32 #include "util/u_memory.h"
34 #include "i915_context.h"
35 #include "i915_query.h"
42 static struct pipe_query
*i915_create_query(struct pipe_context
*ctx
,
45 struct i915_query
*query
= CALLOC_STRUCT( i915_query
);
47 return (struct pipe_query
*)query
;
50 static void i915_destroy_query(struct pipe_context
*ctx
,
51 struct pipe_query
*query
)
56 static void i915_begin_query(struct pipe_context
*ctx
,
57 struct pipe_query
*query
)
61 static void i915_end_query(struct pipe_context
*ctx
, struct pipe_query
*query
)
65 static boolean
i915_get_query_result(struct pipe_context
*ctx
,
66 struct pipe_query
*query
,
70 uint64_t *result
= (uint64_t*)vresult
;
77 i915_init_query_functions(struct i915_context
*i915
)
79 i915
->base
.create_query
= i915_create_query
;
80 i915
->base
.destroy_query
= i915_destroy_query
;
81 i915
->base
.begin_query
= i915_begin_query
;
82 i915
->base
.end_query
= i915_end_query
;
83 i915
->base
.get_query_result
= i915_get_query_result
;