ilo: add PIPE_QUERY_OCCLUSION_PREDICATE support
authorIlia Mirkin <imirkin@alum.mit.edu>
Thu, 4 Feb 2016 17:47:42 +0000 (12:47 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 9 Feb 2016 16:59:27 +0000 (11:59 -0500)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
src/gallium/drivers/ilo/ilo_draw.c
src/gallium/drivers/ilo/ilo_query.c
src/gallium/drivers/ilo/ilo_render.c

index 69f36ae5df60213d6892c29e65cb60a684b52dd0..6831d2c4eff381b5050b86daad171f59a0ba0e89 100644 (file)
@@ -71,6 +71,7 @@ query_process_bo(const struct ilo_context *ilo, struct ilo_query *q)
 
    switch (q->type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_TIME_ELAPSED:
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
@@ -157,6 +158,7 @@ ilo_init_draw_query(struct ilo_context *ilo, struct ilo_query *q)
 
    switch (q->type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_TIME_ELAPSED:
    case PIPE_QUERY_PRIMITIVES_GENERATED:
    case PIPE_QUERY_PRIMITIVES_EMITTED:
index 27d08128ab0f2bad4652ef172486315f344c7b2a..106bd42a335061a455bdf642ac4e10992f71ea69 100644 (file)
@@ -47,7 +47,7 @@ static const struct {
 #define INFOX(prefix) { NULL, NULL, NULL, NULL, }
 
    [PIPE_QUERY_OCCLUSION_COUNTER]      = INFO(draw),
-   [PIPE_QUERY_OCCLUSION_PREDICATE]    = INFOX(draw),
+   [PIPE_QUERY_OCCLUSION_PREDICATE]    = INFO(draw),
    [PIPE_QUERY_TIMESTAMP]              = INFO(draw),
    [PIPE_QUERY_TIMESTAMP_DISJOINT]     = INFOX(draw),
    [PIPE_QUERY_TIME_ELAPSED]           = INFO(draw),
@@ -75,6 +75,7 @@ ilo_create_query(struct pipe_context *pipe, unsigned query_type, unsigned index)
 
    switch (query_type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_TIMESTAMP:
    case PIPE_QUERY_TIME_ELAPSED:
    case PIPE_QUERY_PRIMITIVES_GENERATED:
@@ -163,6 +164,12 @@ query_serialize(const struct ilo_query *q, void *buf)
          dst[0] = q->result.u64;
       }
       break;
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
+      {
+         uint64_t *dst = buf;
+         dst[0] = !!q->result.u64;
+      }
+      break;
    case PIPE_QUERY_PIPELINE_STATISTICS:
       {
          const struct pipe_query_data_pipeline_statistics *stats =
index 8bc04df4fabb6e485171de4539e8b1b83eeac33d..9a47ca80505ec0b6b1f2cf042307e36e514eb19e 100644 (file)
@@ -202,6 +202,7 @@ ilo_render_get_query_len(const struct ilo_render *render,
 
    switch (query_type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_TIMESTAMP:
    case PIPE_QUERY_TIME_ELAPSED:
       /* no reg */
@@ -268,6 +269,7 @@ ilo_render_emit_query(struct ilo_render *render,
 
    switch (q->type) {
    case PIPE_QUERY_OCCLUSION_COUNTER:
+   case PIPE_QUERY_OCCLUSION_PREDICATE:
       pipe_control_dw1 = GEN6_PIPE_CONTROL_DEPTH_STALL |
                          GEN6_PIPE_CONTROL_WRITE_PS_DEPTH_COUNT;
       break;