Module: Mesa Branch: master Commit: 5e310e9f8300a357d6bdaf098c72098518b564f3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5e310e9f8300a357d6bdaf098c72098518b564f3
Author: Paul Berry <stereotype...@gmail.com> Date: Wed Jun 20 12:31:46 2012 -0700 mesa: Add UsesDFdy to struct gl_fragment_program. 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 boolean will allow it to avoid unnecessarily recompiling shaders that don't use dFdy(). Reviewed-by: Brian Paul <bri...@vmware.com> Reviewed-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Ian Romanick <ian.d.roman...@intel.com> --- src/mesa/main/mtypes.h | 1 + src/mesa/program/program.c | 2 ++ 2 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 1f74e6a..4769e10 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2011,6 +2011,7 @@ struct gl_fragment_program { struct gl_program Base; /**< base class */ GLboolean UsesKill; /**< shader uses KIL instruction */ + GLboolean UsesDFdy; /**< shader uses DDY instruction */ GLboolean OriginUpperLeft; GLboolean PixelCenterInteger; enum gl_frag_depth_layout FragDepthLayout; diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c index 23138ea..15337f4 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -546,6 +546,7 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog) const struct gl_fragment_program *fp = gl_fragment_program_const(prog); struct gl_fragment_program *fpc = gl_fragment_program(clone); fpc->UsesKill = fp->UsesKill; + fpc->UsesDFdy = fp->UsesDFdy; fpc->OriginUpperLeft = fp->OriginUpperLeft; fpc->PixelCenterInteger = fp->PixelCenterInteger; } @@ -767,6 +768,7 @@ _mesa_combine_programs(struct gl_context *ctx, newFprog = gl_fragment_program(newProg); newFprog->UsesKill = fprogA->UsesKill || fprogB->UsesKill; + newFprog->UsesDFdy = fprogA->UsesDFdy || fprogB->UsesDFdy; /* We'll do a search and replace for instances * of progB_colorFile/progB_colorIndex below... _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit