freedreno: fix PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE
authorRob Clark <robdclark@gmail.com>
Sun, 1 Oct 2017 19:29:24 +0000 (15:29 -0400)
committerRob Clark <robdclark@gmail.com>
Mon, 2 Oct 2017 12:44:57 +0000 (08:44 -0400)
Fixes an assert in fd_acc_query_register_provider() about query provider
not already registered.

Fixes: 3f6b3d9d ("gallium: add PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE")
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/freedreno_batch.h
src/gallium/drivers/freedreno/freedreno_query.h

index d6a818a3b77a0548f9f5cd07da0e3b6535f51ef6..41356e3519fbda5d63aa44f2517c490d94103786 100644 (file)
@@ -55,7 +55,7 @@ enum fd_render_stage {
        FD_STAGE_ALL      = 0xff,
 };
 
-#define MAX_HW_SAMPLE_PROVIDERS 4
+#define MAX_HW_SAMPLE_PROVIDERS 5
 struct fd_hw_sample_provider;
 struct fd_hw_sample;
 
index b8fa0951ded4acdb3a3c515c33e4a739c5cef032..a391a7a0ff8bb80752d5d86cb687600e2db69f7d 100644 (file)
@@ -85,15 +85,16 @@ int pidx(unsigned query_type)
        case PIPE_QUERY_OCCLUSION_COUNTER:
                return 0;
        case PIPE_QUERY_OCCLUSION_PREDICATE:
-       case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
                return 1;
+       case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
+               return 2;
        /* TODO currently queries only emitted in main pass (not in binning pass)..
         * which is fine for occlusion query, but pretty much not anything else.
         */
        case PIPE_QUERY_TIME_ELAPSED:
-               return 2;
-       case PIPE_QUERY_TIMESTAMP:
                return 3;
+       case PIPE_QUERY_TIMESTAMP:
+               return 4;
        default:
                return -1;
        }