Module: Mesa
Branch: master
Commit: 992e2cf57f5a1eaab13ea6a3b5904b8248af8c83
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=992e2cf57f5a1eaab13ea6a3b5904b8248af8c83

Author: Kenneth Graunke <[email protected]>
Date:   Thu Oct 26 15:22:45 2017 -0700

i965: Only set key->high_quality_derivatives when it matters.

This avoids recompiles for shaders that don't use explicit derivatives
when ctx->Hint.FragmentShaderDerivative == GL_NICEST.

For example, GFXBench 5 Aztec Ruins sets the GL_NICEST hint before
compiling any shaders, but none of them use dFdx() or dFdy() - only
implicit derivatives.  This doesn't eliminate any recompiles, but
does eliminate one of the reasons for doing so.

Reviewed-by: Jason Ekstrand <[email protected]>

---

 src/mesa/drivers/dri/i965/brw_wm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/mesa/drivers/dri/i965/brw_wm.c 
b/src/mesa/drivers/dri/i965/brw_wm.c
index ad1c8aed79..a1e39b55fc 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -521,6 +521,7 @@ brw_wm_populate_key(struct brw_context *brw, struct 
brw_wm_prog_key *key)
 
    /* _NEW_HINT */
    key->high_quality_derivatives =
+      prog->info.uses_fddx_fddy &&
       ctx->Hint.FragmentShaderDerivative == GL_NICEST;
 
    if (devinfo->gen < 6)

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to