radeonsi: disable alpha-to-coverage for integer colorbuffers
authorMarek Olšák <marek.olsak@amd.com>
Wed, 7 Aug 2013 22:26:02 +0000 (00:26 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 16 Aug 2013 23:48:25 +0000 (01:48 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/radeonsi_shader.h
src/gallium/drivers/radeonsi/si_state_draw.c

index d12892b3b6ace7ece800940a8c2a55ed39926625..6c6b96e033a8b69c3cd129b8440841205902b9c0 100644 (file)
@@ -145,6 +145,7 @@ struct si_pipe_shader {
        unsigned                        spi_ps_input_ena;
        unsigned                        spi_shader_col_format;
        unsigned                        cb_shader_mask;
+       bool                            cb0_is_integer;
        unsigned                        sprite_coord_enable;
        unsigned                        so_strides[4];
        union si_shader_key             key;
index ceaead0b71a8c035b50353765496c67478f4b6cc..6be10c84cc901abefc9f292e852438f9b717ada3 100644 (file)
@@ -136,7 +136,9 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
 
        si_pm4_inval_shader_cache(pm4);
 
-       db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z);
+       db_shader_control = S_02880C_Z_ORDER(V_02880C_EARLY_Z_THEN_LATE_Z) |
+                           S_02880C_ALPHA_TO_MASK_DISABLE(rctx->fb_cb0_is_integer);
+
        for (i = 0; i < shader->shader.ninput; i++) {
                switch (shader->shader.input[i].name) {
                case TGSI_SEMANTIC_POSITION:
@@ -256,6 +258,7 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
 
        si_pm4_set_reg(pm4, R_02880C_DB_SHADER_CONTROL, db_shader_control);
 
+       shader->cb0_is_integer = rctx->fb_cb0_is_integer;
        shader->sprite_coord_enable = rctx->sprite_coord_enable;
        si_pm4_bind_state(rctx, ps, shader->pm4);
 }
@@ -445,6 +448,10 @@ static void si_update_derived_state(struct r600_context *rctx)
 
                ps_dirty = 0;
        }
+       if (rctx->ps_shader->current->cb0_is_integer != rctx->fb_cb0_is_integer) {
+               si_pipe_shader_ps(ctx, rctx->ps_shader->current);
+               ps_dirty = 1;
+       }
 
        if (ps_dirty) {
                si_pm4_bind_state(rctx, ps, rctx->ps_shader->current->pm4);