From ce44b2061cf59264b4f22271e8d70cdc826af6de Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 24 Nov 2014 23:30:51 -0800 Subject: i965: Rename CACHE_NEW_*_PROG to BRW_NEW_*_PROG_DATA. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now that we've moved a bunch of CACHE_NEW_* bits to BRW_NEW_*, the only ones that are left are legitimately related to the program cache. Yet, it seems a bit wasteful to have an entire bitfield for only 7 bits. State upload is one of the hottest paths in the driver. For each atom in the list, we call check_state() to see if it needs to be emitted. Currently, this involves comparing three separate bitfields (mesa, brw, and cache). Consolidating the brw and cache bitfields would save a small amount of CPU overhead per atom. Broadwell, for example, has 57 state atoms, so this small savings can add up. CACHE_NEW_*_PROG covers the brw_*_prog_data structures, as well as the offset into the program cache BO (prog_offset). Since most uses refer to brw_*_prog_data, I decided to use BRW_NEW_*_PROG_DATA as the name. Removing "cache" completely is a bit painful, so I decided to do it in several patches for easier review, and to separate mechanical changes from manual ones. This one simply renames things, and was made via: $ for file in *.[ch]; do sed -i -e 's/CACHE_NEW_\([A-Z_\*]*\)_PROG/BRW_NEW_\1_PROG_DATA/g' \ -e 's/BRW_NEW_WM_PROG_DATA/BRW_NEW_FS_PROG_DATA/g' $file done Note that BRW_NEW_*_PROG_DATA is still in .cache, not .brw! The next patch will remedy this flaw. It will also fix the alphabetization issues. Signed-off-by: Kenneth Graunke Reviewed-by: Kristian Høgsberg Acked-by: Matt Turner --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/i965/brw_wm_surface_state.c') 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 dfe59cf..f74c320 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -483,7 +483,7 @@ brw_upload_wm_pull_constants(struct brw_context *brw) /* BRW_NEW_FRAGMENT_PROGRAM */ struct brw_fragment_program *fp = (struct brw_fragment_program *) brw->fragment_program; - /* CACHE_NEW_WM_PROG */ + /* BRW_NEW_FS_PROG_DATA */ struct brw_stage_prog_data *prog_data = &brw->wm.prog_data->base; /* _NEW_PROGRAM_CONSTANTS */ @@ -496,7 +496,7 @@ const struct brw_tracked_state brw_wm_pull_constants = { .mesa = _NEW_PROGRAM_CONSTANTS, .brw = BRW_NEW_BATCH | BRW_NEW_FRAGMENT_PROGRAM, - .cache = CACHE_NEW_WM_PROG, + .cache = BRW_NEW_FS_PROG_DATA, }, .emit = brw_upload_wm_pull_constants, }; @@ -883,7 +883,7 @@ brw_upload_wm_ubo_surfaces(struct brw_context *brw) if (!prog) return; - /* CACHE_NEW_WM_PROG */ + /* BRW_NEW_FS_PROG_DATA */ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_FRAGMENT], &brw->wm.base, &brw->wm.prog_data->base); } @@ -893,7 +893,7 @@ const struct brw_tracked_state brw_wm_ubo_surfaces = { .mesa = _NEW_PROGRAM, .brw = BRW_NEW_BATCH | BRW_NEW_UNIFORM_BUFFER, - .cache = CACHE_NEW_WM_PROG, + .cache = BRW_NEW_FS_PROG_DATA, }, .emit = brw_upload_wm_ubo_surfaces, }; @@ -933,7 +933,7 @@ brw_upload_wm_abo_surfaces(struct brw_context *brw) struct gl_shader_program *prog = ctx->Shader._CurrentFragmentProgram; if (prog) { - /* CACHE_NEW_WM_PROG */ + /* BRW_NEW_FS_PROG_DATA */ brw_upload_abo_surfaces(brw, prog, &brw->wm.base, &brw->wm.prog_data->base); } @@ -944,7 +944,7 @@ const struct brw_tracked_state brw_wm_abo_surfaces = { .mesa = _NEW_PROGRAM, .brw = BRW_NEW_ATOMIC_BUFFER | BRW_NEW_BATCH, - .cache = CACHE_NEW_WM_PROG, + .cache = BRW_NEW_FS_PROG_DATA, }, .emit = brw_upload_wm_abo_surfaces, }; -- cgit v1.1