From 7a0fd3ca1d436591117d451ecee209a4cdb65aef Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 17 Mar 2014 13:53:44 -0700 Subject: 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 Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/i965/intel_screen.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/drivers/dri/i965/intel_screen.c') diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index 3536922..4e9a775 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -1354,6 +1354,9 @@ __DRIconfig **intelInitScreen2(__DRIscreen *psp) psp->extensions = !intelScreen->has_context_reset_notification ? intelScreenExtensions : intelRobustScreenExtensions; + brw_fs_alloc_reg_sets(intelScreen); + brw_vec4_alloc_reg_set(intelScreen); + return (const __DRIconfig**) intel_screen_make_configs(psp); } -- cgit v1.1