From 9ae10e9cbdfce6404a3d86188f2897d8f5d0dcb2 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 9 Nov 2011 21:32:17 -0800 Subject: [PATCH] i965: Make Gen6+ renderbuffer surface updates not depend on NEW_COLOR. 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 Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 9 +++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index f004633c27e..2157ffd37e8 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -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; diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index a9efc95775e..730a0e8a12b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -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, diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 377b19dae5d..0cc62017cbe 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -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. */ -- 2.30.2