aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/gen7_wm_state.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-11-24 23:30:51 -0800
committerKenneth Graunke <[email protected]>2014-12-02 17:00:26 -0800
commitce44b2061cf59264b4f22271e8d70cdc826af6de (patch)
tree9dade4ef4bede55eab23459281b0652e42ae4328 /src/mesa/drivers/dri/i965/gen7_wm_state.c
parent2a4f5728ad27bd1605b3604908caa9ad4983e256 (diff)
i965: Rename CACHE_NEW_*_PROG to BRW_NEW_*_PROG_DATA.
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 <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Acked-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen7_wm_state.c')
-rw-r--r--src/mesa/drivers/dri/i965/gen7_wm_state.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c
index e966d7b04ee..83a5152c67a 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
@@ -39,7 +39,7 @@ upload_wm_state(struct brw_context *brw)
/* BRW_NEW_FRAGMENT_PROGRAM */
const struct brw_fragment_program *fp =
brw_fragment_program_const(brw->fragment_program);
- /* CACHE_NEW_WM_PROG */
+ /* BRW_NEW_FS_PROG_DATA */
const struct brw_wm_prog_data *prog_data = brw->wm.prog_data;
bool writes_depth = false;
uint32_t dw1, dw2;
@@ -133,7 +133,7 @@ const struct brw_tracked_state gen7_wm_state = {
_NEW_POLYGON,
.brw = BRW_NEW_BATCH |
BRW_NEW_FRAGMENT_PROGRAM,
- .cache = CACHE_NEW_WM_PROG,
+ .cache = BRW_NEW_FS_PROG_DATA,
},
.emit = upload_wm_state,
};
@@ -146,7 +146,7 @@ upload_ps_state(struct brw_context *brw)
const int max_threads_shift = brw->is_haswell ?
HSW_PS_MAX_THREADS_SHIFT : IVB_PS_MAX_THREADS_SHIFT;
- /* CACHE_NEW_WM_PROG */
+ /* BRW_NEW_FS_PROG_DATA */
const struct brw_wm_prog_data *prog_data = brw->wm.prog_data;
dw2 = dw4 = dw5 = ksp2 = 0;
@@ -203,7 +203,7 @@ upload_ps_state(struct brw_context *brw)
else
dw4 |= GEN7_PS_POSOFFSET_NONE;
- /* CACHE_NEW_WM_PROG | _NEW_COLOR
+ /* BRW_NEW_FS_PROG_DATA | _NEW_COLOR
*
* The hardware wedges if you have this bit set but don't turn on any dual
* source blend factors.
@@ -214,7 +214,7 @@ upload_ps_state(struct brw_context *brw)
dw4 |= GEN7_PS_DUAL_SOURCE_BLEND_ENABLE;
}
- /* CACHE_NEW_WM_PROG */
+ /* BRW_NEW_FS_PROG_DATA */
if (prog_data->num_varying_inputs != 0)
dw4 |= GEN7_PS_ATTRIBUTE_ENABLE;
@@ -277,7 +277,7 @@ const struct brw_tracked_state gen7_ps_state = {
_NEW_MULTISAMPLE,
.brw = BRW_NEW_BATCH |
BRW_NEW_FRAGMENT_PROGRAM,
- .cache = CACHE_NEW_WM_PROG
+ .cache = BRW_NEW_FS_PROG_DATA
},
.emit = upload_ps_state,
};