gallium/radeon: pass old_(perfect_)enable to set_occlusion_query_state
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 8 Sep 2017 09:54:37 +0000 (11:54 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 18 Sep 2017 09:25:19 +0000 (11:25 +0200)
The callee can derive the current enable state itself.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
src/gallium/drivers/r600/r600_state_common.c
src/gallium/drivers/radeon/r600_pipe_common.h
src/gallium/drivers/radeon/r600_query.c
src/gallium/drivers/radeonsi/si_state.c

index 1515c28091cbc64c139c4010301613ac3671150c..38f4ca0fc468da83a7d43d69faacc2b18502a2de 100644 (file)
@@ -2914,7 +2914,9 @@ static void r600_set_active_query_state(struct pipe_context *ctx, boolean enable
        }
 }
 
-static void r600_set_occlusion_query_state(struct pipe_context *ctx, bool enable)
+static void r600_set_occlusion_query_state(struct pipe_context *ctx,
+                                          bool old_enable,
+                                          bool old_perfect_enable)
 {
        struct r600_context *rctx = (struct r600_context*)ctx;
 
index 08220bdfd8d7e1f41d234bb4354f655644fe6377..46db2c968f31332488b6776c3532cd51eaed6581 100644 (file)
@@ -704,7 +704,9 @@ struct r600_common_context {
                              uint64_t old_gpu_address);
 
        /* Enable or disable occlusion queries. */
-       void (*set_occlusion_query_state)(struct pipe_context *ctx, bool enable);
+       void (*set_occlusion_query_state)(struct pipe_context *ctx,
+                                         bool old_enable,
+                                         bool old_perfect_enable);
 
        void (*save_qbo_state)(struct pipe_context *ctx, struct r600_qbo_state *st);
 
index e655bbdaa23a147601e67324c1bdb9385df0d89d..66bf4d8825885f825aff01ad2206bf76d4412b26 100644 (file)
@@ -713,7 +713,8 @@ static void r600_update_occlusion_query_state(struct r600_common_context *rctx,
                perfect_enable = rctx->num_perfect_occlusion_queries != 0;
 
                if (enable != old_enable || perfect_enable != old_perfect_enable) {
-                       rctx->set_occlusion_query_state(&rctx->b, enable);
+                       rctx->set_occlusion_query_state(&rctx->b, old_enable,
+                                                       old_perfect_enable);
                }
        }
 }
index 1602406000ea59ef1dd47a87be5645cc9d1d450e..f2a6a259919da3a664646dea789a15399ad42f51 100644 (file)
@@ -1191,7 +1191,9 @@ static void si_set_active_query_state(struct pipe_context *ctx, boolean enable)
        }
 }
 
-static void si_set_occlusion_query_state(struct pipe_context *ctx, bool enable)
+static void si_set_occlusion_query_state(struct pipe_context *ctx,
+                                        bool old_enable,
+                                        bool old_perfect_enable)
 {
        struct si_context *sctx = (struct si_context*)ctx;