From c5413839b3e99c7b162f1260142f3c175502b0ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 15:51:29 -0800 Subject: i965: avoid memsetting all the BRW_WM_MAX_INSN arrays for every compile. For an app that's blowing out the state cache, like sauerbraten, the memset of the giant arrays ended up taking 11% of the CPU even when only a "few" of the entries got used. With this, the WM program compile drops back down to 1% of CPU time. Bug #24981 (bisected to BRW_WM_MAX_INSN increase). --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/drivers/dri/i965/brw_wm_fp.c') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 549afd31de..1c4f62ba48 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -182,6 +182,8 @@ static void release_temp( struct brw_wm_compile *c, struct prog_dst_register tem static struct prog_instruction *get_fp_inst(struct brw_wm_compile *c) { assert(c->nr_fp_insns < BRW_WM_MAX_INSN); + memset(&c->prog_instructions[c->nr_fp_insns], 0, + sizeof(*c->prog_instructions)); return &c->prog_instructions[c->nr_fp_insns++]; } -- cgit v1.2.3