summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2018-05-15 12:31:55 +1000
committerDave Airlie <airlied@redhat.com>2018-05-15 12:31:55 +1000
commit7176481ccc53f74c00beab601055c4872ed21593 (patch)
tree25b87e1dc4605e444a0200e4dd6bda1babf744e8
parent3ae74c3b0fcadf2f3c4f5427575ccb79483e1ac6 (diff)
arb_gpu_shader5: add support for indexed queries
-rw-r--r--src/vrend_decode.c2
-rw-r--r--src/vrend_renderer.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/vrend_decode.c b/src/vrend_decode.c
index 5f62568..96f6077 100644
--- a/src/vrend_decode.c
+++ b/src/vrend_decode.c
@@ -659,7 +659,7 @@ static int vrend_decode_create_query(struct vrend_decode_ctx *ctx, uint32_t hand
tmp = get_buf_entry(ctx, VIRGL_OBJ_QUERY_TYPE_INDEX);
query_type = VIRGL_OBJ_QUERY_TYPE(tmp);
- query_index = VIRGL_OBJ_QUERY_INDEX(tmp);
+ query_index = (tmp >> 16) & 0xffff;
offset = get_buf_entry(ctx, VIRGL_OBJ_QUERY_OFFSET);
res_handle = get_buf_entry(ctx, VIRGL_OBJ_QUERY_RES_HANDLE);
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 3e52166..82188d8 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -6403,7 +6403,10 @@ void vrend_begin_query(struct vrend_context *ctx, uint32_t handle)
if (q->gltype == GL_TIMESTAMP)
return;
- glBeginQuery(q->gltype, q->id);
+ if (q->index > 0)
+ glBeginQueryIndexed(q->gltype, q->index, q->id);
+ else
+ glBeginQuery(q->gltype, q->id);
}
void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
@@ -6425,7 +6428,10 @@ void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
return;
}
- glEndQuery(q->gltype);
+ if (q->index > 0)
+ glEndQueryIndexed(q->gltype, q->index);
+ else
+ glEndQuery(q->gltype);
}
void vrend_get_query_result(struct vrend_context *ctx, uint32_t handle,