radeonsi: emit_msaa_sample_locs packets optimization
authorSonny Jiang <sonny.jiang@amd.com>
Thu, 7 Jun 2018 16:13:51 +0000 (12:13 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Fri, 8 Jun 2018 03:26:36 +0000 (23:26 -0400)
Remembering latest states of registers to eliminate redunant SET_CONTEXT_REG packets

Signed-off-by: Sonny Jiang <sonny.jiang@amd.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c
src/gallium/drivers/radeonsi/si_state.h

index 5f3ab45f42f14e8729e511d74334abeafcb3db09..199d7408d797529613e024df4d0607f9e8b03320 100644 (file)
@@ -3250,8 +3250,10 @@ static void si_emit_msaa_sample_locs(struct si_context *sctx)
                    rs && !rs->multisample_enable)
                        small_prim_filter_cntl &= C_028830_SMALL_PRIM_FILTER_ENABLE;
 
-               radeon_set_context_reg(cs, R_028830_PA_SU_SMALL_PRIM_FILTER_CNTL,
-                                      small_prim_filter_cntl);
+               radeon_opt_set_context_reg(sctx,
+                                          R_028830_PA_SU_SMALL_PRIM_FILTER_CNTL,
+                                          SI_TRACKED_PA_SU_SMALL_PRIM_FILTER_CNTL,
+                                          small_prim_filter_cntl);
        }
 }
 
index a5af7de227474163e6572af5285d7403353037f2..5ff4f5714f338b94dfd359fc71cb6ddb973a895c 100644 (file)
@@ -227,6 +227,8 @@ enum si_tracked_reg {
        SI_TRACKED_DB_EQAA,
        SI_TRACKED_PA_SC_MODE_CNTL_1,
 
+       SI_TRACKED_PA_SU_SMALL_PRIM_FILTER_CNTL,
+
        SI_NUM_TRACKED_REGS,
 };