[Mesa-dev] [PATCH 7/9] i965: enable varying component packing for BDW+

Timothy Arceri tarceri at itsqueeze.com
Mon Oct 30 04:11:16 UTC 2017


shader-db results BDW:

total instructions in shared programs: 13192895 -> 13182437 (-0.08%)
instructions in affected programs: 827145 -> 816687 (-1.26%)
helped: 5199
HURT: 116

total cycles in shared programs: 539249342 -> 539156566 (-0.02%)
cycles in affected programs: 21894552 -> 21801776 (-0.42%)
helped: 10667
HURT: 7196

LOST:   0
GAINED: 17
---
 src/mesa/drivers/dri/i965/brw_link.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 46dbcac8430..782135430cb 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -329,6 +329,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
        }
     }
 
+   int prev = -1;
    for (stage = 0; stage < ARRAY_SIZE(shProg->_LinkedShaders); stage++) {
       struct gl_linked_shader *shader = shProg->_LinkedShaders[stage];
       if (!shader)
@@ -340,6 +341,12 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
       NIR_PASS_V(prog->nir, nir_lower_samplers, shProg);
       NIR_PASS_V(prog->nir, nir_lower_atomics, shProg);
 
+      if (brw->screen->devinfo.gen >= 8 && prev != -1) {
+         nir_compact_varyings(shProg->_LinkedShaders[prev]->Program->nir,
+                              prog->nir, ctx->API != API_OPENGL_COMPAT);
+      }
+      prev = stage;
+
       infos[stage] = &prog->nir->info;
 
       /* Make a pass over the IR to add state references for any built-in
-- 
2.13.6



More information about the mesa-dev mailing list