[Mesa-dev] [PATCH 1/3] ilo: add PIPE_QUERY_OCCLUSION_PREDICATE support

Ilia Mirkin imirkin at alum.mit.edu
Thu Feb 4 17:52:15 UTC 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 src/gallium/drivers/ilo/ilo_draw.c   | 2 ++
 src/gallium/drivers/ilo/ilo_query.c  | 9 ++++++++-
 src/gallium/drivers/ilo/ilo_render.c | 2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/ilo/ilo_draw.c b/src/gallium/drivers/ilo/ilo_draw.c
index 69f36ae..6831d2c 100644
--- a/src/gallium/drivers/ilo/ilo_draw.c
+++ b/src/gallium/drivers/ilo/ilo_draw.c
@@ -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:
diff --git a/src/gallium/drivers/ilo/ilo_query.c b/src/gallium/drivers/ilo/ilo_query.c
index 27d0812..106bd42 100644
--- a/src/gallium/drivers/ilo/ilo_query.c
+++ b/src/gallium/drivers/ilo/ilo_query.c
@@ -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 =
diff --git a/src/gallium/drivers/ilo/ilo_render.c b/src/gallium/drivers/ilo/ilo_render.c
index 8bc04df..9a47ca8 100644
--- a/src/gallium/drivers/ilo/ilo_render.c
+++ b/src/gallium/drivers/ilo/ilo_render.c
@@ -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;
-- 
2.4.10



More information about the mesa-dev mailing list