Mesa (master): i965: get uses discard from nir info

Timothy Arceri tarceri at kemper.freedesktop.org
Thu Oct 6 05:04:31 UTC 2016


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

Author: Timothy Arceri <timothy.arceri at collabora.com>
Date:   Wed Oct  5 15:13:23 2016 +1100

i965: get uses discard from nir info

This is a step towards dropping the GLSL IR version of
do_set_program_inouts() in i965 and moving towards native nir support.

This is important because we want to eventually convert to nir and
use its optimisations passes before we can call this GLSL IR pass.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

---

 src/mesa/drivers/dri/i965/brw_wm.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index b0167d2..aac0469 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -448,8 +448,10 @@ brw_wm_populate_key(struct brw_context *brw, struct brw_wm_prog_key *key)
     */
    if (brw->gen < 6) {
       /* _NEW_COLOR */
-      if (fp->program.UsesKill || ctx->Color.AlphaEnabled)
+      if (fp->program.Base.nir->info.fs.uses_discard ||
+          ctx->Color.AlphaEnabled) {
 	 lookup |= IZ_PS_KILL_ALPHATEST_BIT;
+      }
 
       if (fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH))
 	 lookup |= IZ_PS_COMPUTES_DEPTH_BIT;
@@ -601,7 +603,7 @@ brw_fs_precompile(struct gl_context *ctx,
    memset(&key, 0, sizeof(key));
 
    if (brw->gen < 6) {
-      if (fp->UsesKill)
+      if (fp->Base.nir->info.fs.uses_discard)
          key.iz_lookup |= IZ_PS_KILL_ALPHATEST_BIT;
 
       if (fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH))




More information about the mesa-commit mailing list