i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 10 Nov 2011 05:32:17 +0000 (21:32 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 11 Nov 2011 06:51:20 +0000 (22:51 -0800)
NEW_COLOR is only needed on Gen4-5 as brw_update_renderbuffer_surfaces
only uses ctx->Color when intel->gen < 6.

This should reduce unnecessary state updates.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_state.h
src/mesa/drivers/dri/i965/brw_state_upload.c
src/mesa/drivers/dri/i965/brw_wm_surface_state.c

index f004633c27e749aa9385c36f9bca763de94f309d..2157ffd37e8c9a2bd045a79654247a943e5a18d9 100644 (file)
@@ -89,6 +89,7 @@ extern const struct brw_tracked_state gen6_clip_vp;
 extern const struct brw_tracked_state gen6_color_calc_state;
 extern const struct brw_tracked_state gen6_depth_stencil_state;
 extern const struct brw_tracked_state gen6_gs_state;
+extern const struct brw_tracked_state gen6_renderbuffer_surfaces;
 extern const struct brw_tracked_state gen6_sampler_state;
 extern const struct brw_tracked_state gen6_scissor_state;
 extern const struct brw_tracked_state gen6_sf_state;
index a9efc95775e2d75f3bc5456ffe2be44e20f65072..730a0e8a12b32e3e7962bec99eca3cc52a6963da 100644 (file)
@@ -143,7 +143,7 @@ static const struct brw_tracked_state *gen6_atoms[] =
     */
    &brw_vs_pull_constants,
    &brw_wm_pull_constants,
-   &brw_renderbuffer_surfaces,
+   &gen6_renderbuffer_surfaces,
    &brw_texture_surfaces,
    &brw_binding_table,
 
@@ -210,7 +210,7 @@ const struct brw_tracked_state *gen7_atoms[] =
     */
    &brw_vs_pull_constants,
    &brw_wm_pull_constants,
-   &brw_renderbuffer_surfaces,
+   &gen6_renderbuffer_surfaces,
    &brw_texture_surfaces,
    &brw_binding_table,
 
index 377b19dae5d401fe3b05c8ef389c4bee40ceffe2..0cc62017cbe70991bf6856dbb9206678b79e713d 100644 (file)
@@ -577,6 +577,15 @@ const struct brw_tracked_state brw_renderbuffer_surfaces = {
    .emit = brw_update_renderbuffer_surfaces,
 };
 
+const struct brw_tracked_state gen6_renderbuffer_surfaces = {
+   .dirty = {
+      .mesa = _NEW_BUFFERS,
+      .brw = BRW_NEW_BATCH,
+      .cache = 0
+   },
+   .emit = brw_update_renderbuffer_surfaces,
+};
+
 /**
  * Construct SURFACE_STATE objects for enabled textures.
  */