aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2012-06-20 13:40:45 -0700
committerPaul Berry <[email protected]>2012-07-19 10:02:25 -0700
commitd08fdacd58dfa6b1926e9df4707dd9e8dd5370c5 (patch)
tree1dec2faf115441417fa7a0188f5dd51335bf9fad /src/mesa/drivers/dri/i965/brw_fs.cpp
parentce1d2f08f9d08bd5d49b2072a94b3d85e3169fb5 (diff)
i965: Avoid unnecessary recompiles for shaders that don't use dFdy().
The i965 back-end needs to compile dFdy() differently for FBOs and window system framebuffers, because Y coordinates are flipped between the two (see commit 82d2596: i965: Compute dFdy() correctly for FBOs). This patch avoids unnecessarily recompiling shaders that don't use dFdy(), by only setting render_to_fbo in the wm program key if the shader actually uses dFdy(). Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index 630150dbffd..85345efc0a4 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2119,19 +2119,13 @@ brw_fs_precompile(struct gl_context *ctx, struct gl_shader_program *prog)
struct brw_context *brw = brw_context(ctx);
struct brw_wm_prog_key key;
- /* As a temporary measure we assume that all programs use dFdy() (and hence
- * need to be compiled differently depending on whether we're rendering to
- * an FBO). FIXME: set this bool correctly based on the contents of the
- * program.
- */
- bool program_uses_dfdy = true;
-
if (!prog->_LinkedShaders[MESA_SHADER_FRAGMENT])
return true;
struct gl_fragment_program *fp = (struct gl_fragment_program *)
prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program;
struct brw_fragment_program *bfp = brw_fragment_program(fp);
+ bool program_uses_dfdy = fp->UsesDFdy;
memset(&key, 0, sizeof(key));