summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_nir.h
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2015-04-07 15:15:09 -0700
committerKenneth Graunke <kenneth@whitecape.org>2015-04-11 12:35:33 -0700
commit89c1feb78d010bc457f5d02be84c955eebf3549f (patch)
tree558425e1ff2c21b99d66ba218f143b6c2759540b /src/mesa/drivers/dri/i965/brw_nir.h
parentb3e286c4575bf6af343c1a03471fd876cdfb5c43 (diff)
downloadexternal_mesa3d-89c1feb78d010bc457f5d02be84c955eebf3549f.zip
external_mesa3d-89c1feb78d010bc457f5d02be84c955eebf3549f.tar.gz
external_mesa3d-89c1feb78d010bc457f5d02be84c955eebf3549f.tar.bz2
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 <kenneth@whitecape.org> Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_nir.h')
-rw-r--r--src/mesa/drivers/dri/i965/brw_nir.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_nir.h b/src/mesa/drivers/dri/i965/brw_nir.h
index 27782a3..3131109 100644
--- a/src/mesa/drivers/dri/i965/brw_nir.h
+++ b/src/mesa/drivers/dri/i965/brw_nir.h
@@ -23,6 +23,7 @@
#pragma once
+#include "brw_context.h"
#include "glsl/nir/nir.h"
#ifdef __cplusplus
@@ -73,6 +74,11 @@ enum {
void brw_nir_analyze_boolean_resolves(nir_shader *nir);
+nir_shader *brw_create_nir(struct brw_context *brw,
+ const struct gl_shader_program *shader_prog,
+ const struct gl_program *prog,
+ gl_shader_stage stage);
+
#ifdef __cplusplus
}
#endif