r600/cm: (trivial) code cleanup for emitting msaa state
authorRoland Scheidegger <sroland@vmware.com>
Sat, 3 Feb 2018 19:11:35 +0000 (20:11 +0100)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 8 Feb 2018 03:07:52 +0000 (04:07 +0100)
No functional change (compile tested only).

Reviewed-by: Dave Airlie <airlied@redhate.com>
src/gallium/drivers/r600/cayman_msaa.c
src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_pipe_common.h

index 6bc307a4bc1d39464d7a651ea1bf5515f10e1686..f97924ac22c537172095b4ea0ff93fdbba6cef59 100644 (file)
@@ -141,7 +141,7 @@ void cayman_init_msaa(struct pipe_context *ctx)
                cayman_get_sample_position(ctx, 16, i, rctx->sample_locations_16x[i]);
 }
 
-void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples)
+static void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples)
 {
        switch (nr_samples) {
        default:
@@ -202,9 +202,8 @@ void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples)
        }
 }
 
-void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
-                            int ps_iter_samples, int overrast_samples,
-                            unsigned sc_mode_cntl_1)
+void cayman_emit_msaa_state(struct radeon_winsys_cs *cs, int nr_samples,
+                           int ps_iter_samples, int overrast_samples)
 {
        int setup_samples = nr_samples > 1 ? nr_samples :
                            overrast_samples > 1 ? overrast_samples : 0;
@@ -216,6 +215,13 @@ void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
         *       endcaps.
         */
        unsigned sc_line_cntl = S_028BDC_DX10_DIAMOND_TEST_ENA(1);
+       unsigned sc_mode_cntl_1 =
+               EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
+               EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1);
+
+       if (nr_samples > 1) {
+               cayman_emit_msaa_sample_locs(cs, nr_samples);
+       }
 
        if (setup_samples > 1) {
                /* indexed by log2(nr_samples) */
index 742ca5babb3c73f9dd645497dda3e8532b7e5de0..fcd742c5f953505677d0f76764a7f372e9cc6cfc 100644 (file)
@@ -1956,14 +1956,8 @@ static void evergreen_emit_framebuffer_state(struct r600_context *rctx, struct r
        if (rctx->b.chip_class == EVERGREEN) {
                evergreen_emit_msaa_state(rctx, rctx->framebuffer.nr_samples, rctx->ps_iter_samples);
        } else {
-               unsigned sc_mode_cntl_1 =
-                       EG_S_028A4C_FORCE_EOV_CNTDWN_ENABLE(1) |
-                       EG_S_028A4C_FORCE_EOV_REZ_ENABLE(1);
-
-               if (rctx->framebuffer.nr_samples > 1)
-                       cayman_emit_msaa_sample_locs(cs, rctx->framebuffer.nr_samples);
-               cayman_emit_msaa_config(cs, rctx->framebuffer.nr_samples,
-                                       rctx->ps_iter_samples, 0, sc_mode_cntl_1);
+               cayman_emit_msaa_state(cs, rctx->framebuffer.nr_samples,
+                                      rctx->ps_iter_samples, 0);
        }
 }
 
index 86a20f8639b80f0596a4b61afe8ecce0eb1d93aa..ee8eb54920ea220601e9a2aec3ac5d8d65051804 100644 (file)
@@ -799,10 +799,8 @@ extern const unsigned eg_max_dist_4x;
 void cayman_get_sample_position(struct pipe_context *ctx, unsigned sample_count,
                                unsigned sample_index, float *out_value);
 void cayman_init_msaa(struct pipe_context *ctx);
-void cayman_emit_msaa_sample_locs(struct radeon_winsys_cs *cs, int nr_samples);
-void cayman_emit_msaa_config(struct radeon_winsys_cs *cs, int nr_samples,
-                            int ps_iter_samples, int overrast_samples,
-                            unsigned sc_mode_cntl_1);
+void cayman_emit_msaa_state(struct radeon_winsys_cs *cs, int nr_samples,
+                           int ps_iter_samples, int overrast_samples);
 
 
 /* Inline helpers. */