Commit 7054ba30 authored by Zack Rusin's avatar Zack Rusin

gallium: adjust the query interface to support custom types

we need to change it to support composite types
parent afa87162
......@@ -50,10 +50,11 @@ static boolean
brw_query_get_result(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result)
void *vresult)
{
struct brw_context *brw = brw_context(pipe);
struct brw_query_object *query = (struct brw_query_object *)q;
uint64_t *result = (uint64_t*)vresult;
/* Map and count the pixels from the current query BO */
if (query->bo) {
......
......@@ -158,7 +158,7 @@ static boolean
identity_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query,
boolean wait,
uint64_t *result)
void *result)
{
struct identity_context *id_pipe = identity_context(_pipe);
struct pipe_context *pipe = id_pipe->pipe;
......
......@@ -77,10 +77,11 @@ static boolean
llvmpipe_get_query_result(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result )
void *vresult)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context( pipe );
struct llvmpipe_query *pq = llvmpipe_query(q);
uint64_t *result = (uint64_t *)vresult;
if (!pq->done) {
lp_setup_flush(llvmpipe->setup, 0);
......
......@@ -106,8 +106,9 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq)
static boolean
nv50_query_result(struct pipe_context *pipe, struct pipe_query *pq,
boolean wait, uint64_t *result)
boolean wait, void *vresult)
{
uint64_t *result = (uint64_t*)vresult;
struct nv50_query *q = nv50_query(pq);
int ret;
......
......@@ -96,8 +96,9 @@ nvfx_query_end(struct pipe_context *pipe, struct pipe_query *pq)
static boolean
nvfx_query_result(struct pipe_context *pipe, struct pipe_query *pq,
boolean wait, uint64_t *result)
boolean wait, void *vresult)
{
uint64_t *result = (uint64_t *)vresult;
struct nvfx_context *nvfx = nvfx_context(pipe);
struct nvfx_query *q = nvfx_query(pq);
......
......@@ -114,7 +114,7 @@ static void r300_end_query(struct pipe_context* pipe,
static boolean r300_get_query_result(struct pipe_context* pipe,
struct pipe_query* query,
boolean wait,
uint64_t* result)
void* vresult)
{
struct r300_context* r300 = r300_context(pipe);
struct r300_screen* r300screen = r300->screen;
......@@ -124,6 +124,7 @@ static boolean r300_get_query_result(struct pipe_context* pipe,
uint32_t* map;
uint32_t temp = 0;
unsigned i, num_results;
uint64_t *result = (uint64_t*)vresult;
if (q->flushed == FALSE)
pipe->flush(pipe, 0, NULL);
......
......@@ -51,7 +51,7 @@ static void r600_end_query(struct pipe_context *pipe, struct pipe_query *query)
static boolean r600_get_query_result(struct pipe_context *pipe,
struct pipe_query *query,
boolean wait, uint64_t *result)
boolean wait, void *result)
{
return TRUE;
}
......
......@@ -241,7 +241,7 @@ static boolean
rbug_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query,
boolean wait,
uint64_t *result)
void *result)
{
struct rbug_context *rb_pipe = rbug_context(_pipe);
struct pipe_context *pipe = rb_pipe->pipe;
......
......@@ -118,9 +118,10 @@ static boolean
softpipe_get_query_result(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result )
void *vresult)
{
struct softpipe_query *sq = softpipe_query(q);
uint64_t *result = (uint64_t*)vresult;
*result = sq->end - sq->start;
return TRUE;
}
......
......@@ -63,7 +63,7 @@ svga_query( struct pipe_query *q )
static boolean svga_get_query_result(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result);
void *result);
static struct pipe_query *svga_create_query( struct pipe_context *pipe,
unsigned query_type )
......@@ -207,13 +207,14 @@ static void svga_end_query(struct pipe_context *pipe,
static boolean svga_get_query_result(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result)
void *vresult)
{
struct svga_context *svga = svga_context( pipe );
struct svga_screen *svgascreen = svga_screen( pipe->screen );
struct svga_winsys_screen *sws = svgascreen->sws;
struct svga_query *sq = svga_query( q );
SVGA3dQueryState state;
uint64_t *result = (uint64_t*)vresult;
SVGA_DBG(DEBUG_QUERY, "%s wait: %d\n", __FUNCTION__);
......
......@@ -248,7 +248,7 @@ static INLINE boolean
trace_context_get_query_result(struct pipe_context *_pipe,
struct pipe_query *query,
boolean wait,
uint64_t *presult)
void *presult)
{
struct trace_context *tr_ctx = trace_context(_pipe);
struct pipe_context *pipe = tr_ctx->pipe;
......@@ -260,7 +260,7 @@ trace_context_get_query_result(struct pipe_context *_pipe,
trace_dump_arg(ptr, pipe);
_result = pipe->get_query_result(pipe, query, wait, presult);
result = *presult;
result = *((uint64_t*)presult);
trace_dump_arg(uint, result);
trace_dump_ret(bool, _result);
......
......@@ -135,10 +135,10 @@ struct pipe_context {
* \param wait if true, this query will block until the result is ready
* \return TRUE if results are ready, FALSE otherwise
*/
boolean (*get_query_result)(struct pipe_context *pipe,
boolean (*get_query_result)(struct pipe_context *pipe,
struct pipe_query *q,
boolean wait,
uint64_t *result);
void *result);
/*@}*/
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment