arb_gpu_shader5: add support for indexed queries

Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
macos/master
Dave Airlie 7 years ago
parent 027a0df49e
commit 0337bcd3ce
  1. 2
      src/vrend_decode.c
  2. 6
      src/vrend_renderer.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); tmp = get_buf_entry(ctx, VIRGL_OBJ_QUERY_TYPE_INDEX);
query_type = VIRGL_OBJ_QUERY_TYPE(tmp); 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); offset = get_buf_entry(ctx, VIRGL_OBJ_QUERY_OFFSET);
res_handle = get_buf_entry(ctx, VIRGL_OBJ_QUERY_RES_HANDLE); res_handle = get_buf_entry(ctx, VIRGL_OBJ_QUERY_RES_HANDLE);

@ -6443,6 +6443,9 @@ void vrend_begin_query(struct vrend_context *ctx, uint32_t handle)
if (q->gltype == GL_TIMESTAMP) if (q->gltype == GL_TIMESTAMP)
return; return;
if (q->index > 0)
glBeginQueryIndexed(q->gltype, q->index, q->id);
else
glBeginQuery(q->gltype, q->id); glBeginQuery(q->gltype, q->id);
} }
@ -6465,6 +6468,9 @@ void vrend_end_query(struct vrend_context *ctx, uint32_t handle)
return; return;
} }
if (q->index > 0)
glEndQueryIndexed(q->gltype, q->index);
else
glEndQuery(q->gltype); glEndQuery(q->gltype);
} }

Loading…
Cancel
Save