radeonsi: emit GS_OUT_PRIM_TYPE only if it changes
authorMarek Olšák <marek.olsak@amd.com>
Sun, 7 Dec 2014 19:15:49 +0000 (20:15 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 10 Dec 2014 20:59:37 +0000 (21:59 +0100)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_hw_context.c
src/gallium/drivers/radeonsi/si_pipe.h
src/gallium/drivers/radeonsi/si_state_draw.c

index 0bbc381bc9c9babbe8ca94953bb14855a62a8668..a40387cadb9437499ace2e3705959baca2e064a3 100644 (file)
@@ -158,4 +158,5 @@ void si_begin_new_cs(struct si_context *ctx)
        si_invalidate_draw_sh_constants(ctx);
        ctx->last_primitive_restart_en = -1;
        ctx->last_restart_index = SI_RESTART_INDEX_UNKNOWN;
+       ctx->last_gs_out_prim = -1;
 }
index 471a55440d686a1994bddb809299614af5886b60..6766635b0a1fa63034ba0b5beb2f6067bef5261d 100644 (file)
@@ -182,6 +182,7 @@ struct si_context {
        int                     last_sh_base_reg;
        int                     last_primitive_restart_en;
        int                     last_restart_index;
+       int                     last_gs_out_prim;
 };
 
 /* si_blit.c */
index 40a55c50fe99d0f6a65d403c5a31d37d181ba988..a65eaa1f7ecee61b80ea9e3b60bd42939d4d0607 100644 (file)
@@ -192,7 +192,10 @@ static void si_emit_draw_registers(struct si_context *sctx,
                r600_write_context_reg(cs, R_028AA8_IA_MULTI_VGT_PARAM, ia_multi_vgt_param);
        }
 
-       r600_write_context_reg(cs, R_028A6C_VGT_GS_OUT_PRIM_TYPE, gs_out_prim);
+       if (gs_out_prim != sctx->last_gs_out_prim) {
+               r600_write_context_reg(cs, R_028A6C_VGT_GS_OUT_PRIM_TYPE, gs_out_prim);
+               sctx->last_gs_out_prim = gs_out_prim;
+       }
 
        /* Primitive restart. */
        if (info->primitive_restart != sctx->last_primitive_restart_en) {