sp_query.c File Reference

Include dependency graph for sp_query.c:

Go to the source code of this file.

Data Structures

struct  softpipe_query

Functions

static struct softpipe_querysoftpipe_query (struct pipe_query *p)
static struct pipe_query * softpipe_create_query (struct pipe_context *pipe, unsigned type)
static void softpipe_destroy_query (struct pipe_context *pipe, struct pipe_query *q)
static void softpipe_begin_query (struct pipe_context *pipe, struct pipe_query *q)
static void softpipe_end_query (struct pipe_context *pipe, struct pipe_query *q)
static boolean softpipe_get_query_result (struct pipe_context *pipe, struct pipe_query *q, boolean wait, uint64 *result)
void softpipe_init_query_funcs (struct softpipe_context *softpipe)


Function Documentation

static void softpipe_begin_query ( struct pipe_context pipe,
struct pipe_query *  q 
) [static]

Definition at line 67 of file sp_query.c.

References softpipe_context::occlusion_count, softpipe_context(), softpipe_query(), and softpipe_query::start.

00068 {
00069    struct softpipe_context *softpipe = softpipe_context( pipe );
00070    struct softpipe_query *sq = softpipe_query(q);
00071    
00072    sq->start = softpipe->occlusion_count;
00073 }

static struct pipe_query* softpipe_create_query ( struct pipe_context pipe,
unsigned  type 
) [static, read]

Definition at line 51 of file sp_query.c.

References assert, CALLOC_STRUCT, and PIPE_QUERY_OCCLUSION_COUNTER.

00053 {
00054    assert(type == PIPE_QUERY_OCCLUSION_COUNTER);
00055    return (struct pipe_query *)CALLOC_STRUCT( softpipe_query );
00056 }

static void softpipe_destroy_query ( struct pipe_context pipe,
struct pipe_query *  q 
) [static]

Definition at line 60 of file sp_query.c.

References FREE.

00061 {
00062    FREE(q);
00063 }

static void softpipe_end_query ( struct pipe_context pipe,
struct pipe_query *  q 
) [static]

Definition at line 77 of file sp_query.c.

References softpipe_query::end, softpipe_context::occlusion_count, softpipe_context(), and softpipe_query().

00078 {
00079    struct softpipe_context *softpipe = softpipe_context( pipe );
00080    struct softpipe_query *sq = softpipe_query(q);
00081 
00082    sq->end = softpipe->occlusion_count;
00083 }

static boolean softpipe_get_query_result ( struct pipe_context pipe,
struct pipe_query *  q,
boolean  wait,
uint64 result 
) [static]

Definition at line 87 of file sp_query.c.

References softpipe_query::end, softpipe_query(), softpipe_query::start, and TRUE.

00091 {
00092    struct softpipe_query *sq = softpipe_query(q);
00093    *result = sq->end - sq->start;
00094    return TRUE;
00095 }

void softpipe_init_query_funcs ( struct softpipe_context softpipe  ) 

Definition at line 98 of file sp_query.c.

References pipe_context::begin_query, pipe_context::create_query, pipe_context::destroy_query, pipe_context::end_query, pipe_context::get_query_result, softpipe_context::pipe, softpipe_begin_query(), softpipe_create_query(), softpipe_destroy_query(), softpipe_end_query(), and softpipe_get_query_result().

00099 {
00100    softpipe->pipe.create_query = softpipe_create_query;
00101    softpipe->pipe.destroy_query = softpipe_destroy_query;
00102    softpipe->pipe.begin_query = softpipe_begin_query;
00103    softpipe->pipe.end_query = softpipe_end_query;
00104    softpipe->pipe.get_query_result = softpipe_get_query_result;
00105 }

static struct softpipe_query* softpipe_query ( struct pipe_query *  p  )  [static, read]

Definition at line 45 of file sp_query.c.

00046 {
00047    return (struct softpipe_query *)p;
00048 }


Generated on Tue Sep 29 06:25:41 2009 for Gallium3D by  doxygen 1.5.4