summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/virgl
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2018-02-14 12:52:27 +1000
committerDave Airlie <[email protected]>2018-02-16 12:42:06 +1000
commit60c14a0db25d3dd246744858179a52548325c25f (patch)
tree0a4bf052d5ba3243c4c63ea2fb9cee1a20a73366 /src/gallium/drivers/virgl
parent8a05b06146c005c0381b4784b4731e7dee8484aa (diff)
virgl: remap query types to hw support.
The gallium query types changed, so we need to remap from the gallium ones to the virgl ones. Fixes: dEQP-GLES3.functional.transform_feedback.basic_types* "This also fixes: dEQP-GLES3.functional.transform_feedback.array.separate* dEQP-GLES3.functional.transform_feedback.array_element* dEQP-GLES3.functional.transform_feedback.interpolation.* Gallium's p_defines.h and virglrenderer's p_defines.h have diverged quite a bit, so not including PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE there makes sense for now." - Gurchetan Singh Fixes: 3f6b3d9db (gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE) Reviewed-by: Gurchetan Singh <[email protected]> Tested-by: Gurchetan Singh <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/gallium/drivers/virgl')
-rw-r--r--src/gallium/drivers/virgl/virgl_query.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/gallium/drivers/virgl/virgl_query.c b/src/gallium/drivers/virgl/virgl_query.c
index e6ca4609c03..3a930d29666 100644
--- a/src/gallium/drivers/virgl/virgl_query.c
+++ b/src/gallium/drivers/virgl/virgl_query.c
@@ -37,6 +37,39 @@ struct virgl_query {
unsigned result_size;
unsigned result_gotten_sent;
};
+#define VIRGL_QUERY_OCCLUSION_COUNTER 0
+#define VIRGL_QUERY_OCCLUSION_PREDICATE 1
+#define VIRGL_QUERY_TIMESTAMP 2
+#define VIRGL_QUERY_TIMESTAMP_DISJOINT 3
+#define VIRGL_QUERY_TIME_ELAPSED 4
+#define VIRGL_QUERY_PRIMITIVES_GENERATED 5
+#define VIRGL_QUERY_PRIMITIVES_EMITTED 6
+#define VIRGL_QUERY_SO_STATISTICS 7
+#define VIRGL_QUERY_SO_OVERFLOW_PREDICATE 8
+#define VIRGL_QUERY_GPU_FINISHED 9
+#define VIRGL_QUERY_PIPELINE_STATISTICS 10
+
+static const int pquery_map[] =
+{
+ VIRGL_QUERY_OCCLUSION_COUNTER,
+ VIRGL_QUERY_OCCLUSION_PREDICATE,
+ -1,
+ VIRGL_QUERY_TIMESTAMP,
+ VIRGL_QUERY_TIMESTAMP_DISJOINT,
+ VIRGL_QUERY_TIME_ELAPSED,
+ VIRGL_QUERY_PRIMITIVES_GENERATED,
+ VIRGL_QUERY_PRIMITIVES_EMITTED,
+ VIRGL_QUERY_SO_STATISTICS,
+ VIRGL_QUERY_SO_OVERFLOW_PREDICATE,
+ -1,
+ VIRGL_QUERY_GPU_FINISHED,
+ VIRGL_QUERY_PIPELINE_STATISTICS,
+};
+
+static int pipe_to_virgl_query(enum pipe_query_type ptype)
+{
+ return pquery_map[ptype];
+}
static inline struct virgl_query *virgl_query(struct pipe_query *q)
{
@@ -75,11 +108,11 @@ static struct pipe_query *virgl_create_query(struct pipe_context *ctx,
}
handle = virgl_object_assign_handle();
- query->type = query_type;
+ query->type = pipe_to_virgl_query(query_type);
query->index = index;
query->handle = handle;
query->buf->clean = FALSE;
- virgl_encoder_create_query(vctx, handle, query_type, index, query->buf, 0);
+ virgl_encoder_create_query(vctx, handle, query->type, index, query->buf, 0);
return (struct pipe_query *)query;
}