summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2014-11-23 23:39:34 -0800
committerKenneth Graunke <[email protected]>2014-11-24 15:30:09 -0800
commitf0c91f32c0b09f27f67cac34cba070bdc5274a15 (patch)
treebf44cf2dd4383b21cfe9ca6c8c8151ffc9dd3e88
parentb55777f39d00a0c54023eba012d326ff09fa530b (diff)
i965: Precompile ARB programs.
We already precompile GLSL programs; it seems logical to precompile ARB programs as well. We just never hooked it up. This also makes the programs compile even if no drawing occurs, which is useful for shader-db. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_program.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c
index 17edb09f723..d9a3f057fec 100644
--- a/src/mesa/drivers/dri/i965/brw_program.c
+++ b/src/mesa/drivers/dri/i965/brw_program.c
@@ -42,6 +42,7 @@
#include "glsl/ir.h"
#include "brw_context.h"
+#include "brw_shader.h"
#include "brw_wm.h"
static unsigned
@@ -136,6 +137,10 @@ brwProgramStringNotify(struct gl_context *ctx,
if (newFP == curFP)
brw->state.dirty.brw |= BRW_NEW_FRAGMENT_PROGRAM;
newFP->id = get_new_program_id(brw->intelScreen);
+
+ brw_add_texrect_params(prog);
+
+ brw_fs_precompile(ctx, NULL, prog);
break;
}
case GL_VERTEX_PROGRAM_ARB: {
@@ -154,6 +159,10 @@ brwProgramStringNotify(struct gl_context *ctx,
/* Also tell tnl about it:
*/
_tnl_program_string(ctx, target, prog);
+
+ brw_add_texrect_params(prog);
+
+ brw_vs_precompile(ctx, NULL, prog);
break;
}
default:
@@ -167,8 +176,6 @@ brwProgramStringNotify(struct gl_context *ctx,
unreachable("Unexpected target in brwProgramStringNotify");
}
- brw_add_texrect_params(prog);
-
return true;
}