r600g: simplify r600_set_occlusion_query_state
authorMarek Olšák <marek.olsak@amd.com>
Fri, 8 Apr 2016 18:23:51 +0000 (20:23 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 12 Apr 2016 12:29:47 +0000 (14:29 +0200)
The caller does the same checking.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_state.c
src/gallium/drivers/r600/r600_state_common.c

index 6595267698751e9cb8b0df346f73b32d47a6a0e5..077664d068e4f334ca0e0bb790ecf13306cf94ae 100644 (file)
@@ -1802,7 +1802,7 @@ static void evergreen_emit_db_misc_state(struct r600_context *rctx, struct r600_
                S_02800C_FORCE_HIS_ENABLE0(V_02800C_FORCE_DISABLE) |
                S_02800C_FORCE_HIS_ENABLE1(V_02800C_FORCE_DISABLE);
 
-       if (a->occlusion_query_enabled) {
+       if (rctx->b.num_occlusion_queries > 0) {
                db_count_control |= S_028004_PERFECT_ZPASS_COUNTS(1);
                if (rctx->b.chip_class == CAYMAN) {
                        db_count_control |= S_028004_SAMPLE_RATE(a->log_samples);
index cd0052a519f0dffba9698948b382a3986c0d2d8e..de3fd06aac3c51a0b86c57f36327762143f33bef 100644 (file)
@@ -120,7 +120,6 @@ struct r600_db_state {
 
 struct r600_db_misc_state {
        struct r600_atom                atom;
-       bool                            occlusion_query_enabled;
        bool                            flush_depthstencil_through_cb;
        bool                            flush_depth_inplace;
        bool                            flush_stencil_inplace;
index 3189a1360b15c593774f86a70aafdf8f9148db58..62b46ce52a139afb828ba9725baa5376829d53d4 100644 (file)
@@ -1644,7 +1644,7 @@ static void r600_emit_db_misc_state(struct r600_context *rctx, struct r600_atom
                }
        }
 
-       if (a->occlusion_query_enabled) {
+       if (rctx->b.num_occlusion_queries > 0) {
                if (rctx->b.chip_class >= R700) {
                        db_render_control |= S_028D0C_R700_PERFECT_ZPASS_COUNTS(1);
                }
index 82babeba7cbb5393f024cfe6825d65d5cc750c97..32a10491e8ba7064938699a57d42e589feef3eab 100644 (file)
@@ -2864,10 +2864,7 @@ static void r600_set_occlusion_query_state(struct pipe_context *ctx, bool enable
 {
        struct r600_context *rctx = (struct r600_context*)ctx;
 
-       if (rctx->db_misc_state.occlusion_query_enabled != enable) {
-               rctx->db_misc_state.occlusion_query_enabled = enable;
-               r600_mark_atom_dirty(rctx, &rctx->db_misc_state.atom);
-       }
+       r600_mark_atom_dirty(rctx, &rctx->db_misc_state.atom);
 }
 
 static void r600_need_gfx_cs_space(struct pipe_context *ctx, unsigned num_dw,