From 89c1feb78d010bc457f5d02be84c955eebf3549f Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 7 Apr 2015 15:15:09 -0700 Subject: i965: Create NIR during LinkShader() and ProgramStringNotify(). Previously, we translated into NIR and did all the optimizations and lowering as part of running fs_visitor. This meant that we did all of that work twice for fragment shaders - once for SIMD8, and again for SIMD16. We also had to redo it every time we hit a state based recompile. We now generate NIR once at link time. ARB programs don't have linking, so we instead generate it at ProgramStringNotify time. Mesa's fixed function vertex program handling doesn't bother to inform the driver about new programs at all (which is rather mean), so we generate NIR at the last minute, if it hasn't happened already. shader-db runs ~9.4% faster on my i7-5600U, with a release build. v2: Check NirOptions != NULL in ProgramStringNotify(). Don't bother using _mesa_program_enum_to_shader_stage as we already know it. Signed-off-by: Kenneth Graunke Reviewed-by: Jason Ekstrand --- src/mesa/drivers/dri/i965/Makefile.sources | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/drivers/dri/i965/Makefile.sources') diff --git a/src/mesa/drivers/dri/i965/Makefile.sources b/src/mesa/drivers/dri/i965/Makefile.sources index 498d5a7..6d4659f 100644 --- a/src/mesa/drivers/dri/i965/Makefile.sources +++ b/src/mesa/drivers/dri/i965/Makefile.sources @@ -77,6 +77,7 @@ i965_FILES = \ brw_misc_state.c \ brw_multisample_state.h \ brw_nir.h \ + brw_nir.c \ brw_nir_analyze_boolean_resolves.c \ brw_object_purgeable.c \ brw_packed_float.c \ -- cgit v1.1