From 5cbd1170da0a902fdc9c460584bc503b0c4085a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Mar 2009 16:04:53 -0700 Subject: i965: avoid unnecessary calls to brw_wm_is_glsl() This function scans the shader to see if it has any GLSL features like conditionals and loops. Calling this during state validation is expensive. Just call it when the shader is given to the driver and save the result. There's some new/temporary assertions to be sure we don't get out of sync on this. --- src/mesa/drivers/dri/i965/brw_wm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/i965/brw_wm.c') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 879000644b..1645ca0b70 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -149,11 +149,14 @@ static void do_wm_prog( struct brw_context *brw, brw_init_compile(brw, &c->func); + /* temporary sanity check assertion */ + ASSERT(fp->isGLSL == brw_wm_is_glsl(&c->fp->program)); + /* * Shader which use GLSL features such as flow control are handled * differently from "simple" shaders. */ - if (brw_wm_is_glsl(&c->fp->program)) { + if (fp->isGLSL) { brw_wm_glsl_emit(brw, c); } else { -- cgit v1.2.3