diff options
author | Paul Berry <[email protected]> | 2012-06-20 12:31:46 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-07-31 12:25:50 -0700 |
commit | 9ca7b5b65e53c09d04ab96351b39dc202f494ef2 (patch) | |
tree | e1a8ae51df4858843d92ca236b3a5ad3d13869f6 | |
parent | c3ad361f47b5e6a9066935b08adc403896f6e95d (diff) |
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 <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
(cherry picked from commit 5e310e9f8300a357d6bdaf098c72098518b564f3)
-rw-r--r-- | src/mesa/main/mtypes.h | 1 | ||||
-rw-r--r-- | 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 b86aeb6c1f1..cc6e9bd9ae1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1974,6 +1974,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 582cbccf8fa..3ad837729f2 100644 --- a/src/mesa/program/program.c +++ b/src/mesa/program/program.c @@ -551,6 +551,7 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog) = (const struct gl_fragment_program *) prog; struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone; fpc->UsesKill = fp->UsesKill; + fpc->UsesDFdy = fp->UsesDFdy; fpc->OriginUpperLeft = fp->OriginUpperLeft; fpc->PixelCenterInteger = fp->PixelCenterInteger; } @@ -772,6 +773,7 @@ _mesa_combine_programs(struct gl_context *ctx, newFprog = (struct 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... |