i965: Allocate register sets at screen creation, not context creation.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 17 Mar 2014 20:53:44 +0000 (13:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 18 Mar 2014 17:35:53 +0000 (10:35 -0700)
commit7a0fd3ca1d436591117d451ecee209a4cdb65aef
tree5aa3329ade2cf11cff4637db62a85d7fdf090d39
parentb3e4b769dd318936abc38acbbbdec61ae2539e84
i965: Allocate register sets at screen creation, not context creation.

Register sets depend on the particular hardware generation, but don't
depend on anything in the actual OpenGL context.  Computing them is
fairly expensive, and they take up a large amount of memory.  Putting
them in the screen allows us to compute/allocate them once for all
contexts, saving both time and space.

Improves the performance of a context creation/destruction
microbenchmark by about 3x on my Haswell i7-4750HQ.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/brw_fs_reg_allocate.cpp
src/mesa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/i965/intel_screen.h