radeonsi: remove cb0_is_integer handling
authorMarek Olšák <marek.olsak@amd.com>
Fri, 16 Sep 2016 20:42:54 +0000 (22:42 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 19 Oct 2016 17:26:30 +0000 (19:26 +0200)
st/mesa does this for us.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state_shaders.c

index e10d3fb4fc5b625a3009e1cdde12f1732b491005..8fc5fcc370f35896c3c72e95c1283694441c98f4 100644 (file)
@@ -165,7 +165,6 @@ struct si_framebuffer {
        struct pipe_framebuffer_state   state;
        unsigned                        nr_samples;
        unsigned                        log_samples;
-       unsigned                        cb0_is_integer;
        unsigned                        compressed_cb_mask;
        unsigned                        spi_shader_col_format;
        unsigned                        spi_shader_col_format_alpha;
index 732f9e9b0922858ed74272c80970dd14aaf8fb15..97bd308e19a0d52615e820cd11b6b8060dcf576e 100644 (file)
@@ -1144,8 +1144,7 @@ static void si_emit_db_render_state(struct si_context *sctx, struct r600_atom *s
                S_028010_DISABLE_SMEM_EXPCLEAR_OPTIMIZATION(sctx->db_stencil_disable_expclear) |
                S_028010_DECOMPRESS_Z_ON_FLUSH(sctx->framebuffer.nr_samples >= 4));
 
-       db_shader_control = S_02880C_ALPHA_TO_MASK_DISABLE(sctx->framebuffer.cb0_is_integer) |
-                           sctx->ps_db_shader_control;
+       db_shader_control = sctx->ps_db_shader_control;
 
        /* Bug workaround for smoothing (overrasterization) on SI. */
        if (sctx->b.chip_class == SI && sctx->smoothing_enabled) {
@@ -2288,7 +2287,6 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
        struct pipe_constant_buffer constbuf = {0};
        struct r600_surface *surf = NULL;
        struct r600_texture *rtex;
-       bool old_cb0_is_integer = sctx->framebuffer.cb0_is_integer;
        bool old_any_dst_linear = sctx->framebuffer.any_dst_linear;
        unsigned old_nr_samples = sctx->framebuffer.nr_samples;
        int i;
@@ -2333,13 +2331,8 @@ static void si_set_framebuffer_state(struct pipe_context *ctx,
        sctx->framebuffer.compressed_cb_mask = 0;
        sctx->framebuffer.nr_samples = util_framebuffer_get_num_samples(state);
        sctx->framebuffer.log_samples = util_logbase2(sctx->framebuffer.nr_samples);
-       sctx->framebuffer.cb0_is_integer = state->nr_cbufs && state->cbufs[0] &&
-                                 util_format_is_pure_integer(state->cbufs[0]->format);
        sctx->framebuffer.any_dst_linear = false;
 
-       if (sctx->framebuffer.cb0_is_integer != old_cb0_is_integer)
-               si_mark_atom_dirty(sctx, &sctx->db_render_state);
-
        for (i = 0; i < state->nr_cbufs; i++) {
                if (!state->cbufs[i])
                        continue;
index d339b8463c327b2cbf00193ae73269274308ac37..137a5d1c8423ba708ca9238d4cbd6e3d04b578bb 100644 (file)
@@ -845,8 +845,7 @@ static void si_shader_init_pm4_state(struct si_screen *sscreen,
 static unsigned si_get_alpha_test_func(struct si_context *sctx)
 {
        /* Alpha-test should be disabled if colorbuffer 0 is integer. */
-       if (sctx->queued.named.dsa &&
-           !sctx->framebuffer.cb0_is_integer)
+       if (sctx->queued.named.dsa)
                return sctx->queued.named.dsa->alpha_func;
 
        return PIPE_FUNC_ALWAYS;
@@ -957,8 +956,7 @@ static inline void si_shader_selector_key(struct pipe_context *ctx,
 
                        if (sctx->queued.named.blend) {
                                key->ps.epilog.alpha_to_one = sctx->queued.named.blend->alpha_to_one &&
-                                                             rs->multisample_enable &&
-                                                             !sctx->framebuffer.cb0_is_integer;
+                                                             rs->multisample_enable;
                        }
 
                        key->ps.prolog.poly_stipple = rs->poly_stipple_enable && is_poly;