aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-10-12 20:06:45 -0700
committerIan Romanick <[email protected]>2012-10-12 20:07:41 -0700
commit454841bedd83bb863c8b88eea78e45fc47ba3825 (patch)
treeaf1459022d3039d49407792c6cb2123e6076493d /src
parent59997d619d8957fca3b2042fe4ebeed0709c0204 (diff)
Revert "i965: Avoid unnecessary recompiles for shaders that don't use dFdy()."
This patch depends on some other patches that were not picked over. As a result, this patch causes a bunch of piglit regressions on SNB. This reverts commit 55d23cfc561e53a8514163a188811bddcc09b7df.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp8
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_emit.cpp4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c8
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_emit.c4
4 files changed, 14 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index f213ca2acde..6a876cc7f36 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -1884,13 +1884,19 @@ 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));
diff --git a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
index e7871a0585a..ebead4fe09d 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_emit.cpp
@@ -921,10 +921,6 @@ fs_visitor::generate_code()
generate_ddx(inst, dst, src[0]);
break;
case FS_OPCODE_DDY:
- /* Make sure fp->UsesDFdy flag got set (otherwise there's no
- * guarantee that c->key.render_to_fbo is set).
- */
- assert(fp->UsesDFdy);
generate_ddy(inst, dst, src[0], c->key.render_to_fbo);
break;
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 86bc182c7c1..11fb03d9785 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -417,7 +417,13 @@ static void brw_wm_populate_key( struct brw_context *brw,
GLuint lookup = 0;
GLuint line_aa;
GLuint i;
- bool program_uses_dfdy = fp->program.UsesDFdy;
+
+ /* 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;
memset(key, 0, sizeof(*key));
diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c
index f98d2f73396..e565b71c66e 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c
@@ -1750,10 +1750,6 @@ void brw_wm_emit( struct brw_wm_compile *c )
break;
case OPCODE_DDY:
- /* Make sure fp->program.UsesDFdy flag got set (otherwise there's no
- * guarantee that c->key.render_to_fbo is set).
- */
- assert(c->fp->program.UsesDFdy);
emit_ddxy(p, dst, dst_flags, false, args[0], c->key.render_to_fbo);
break;