[Mesa-dev] [PATCH 3/3] i965: enable varying component packing for BDW+
Timothy Arceri
tarceri at itsqueeze.com
Wed Oct 18 11:22:12 UTC 2017
shader-db results BDW:
total instructions in shared programs: 13192895 -> 13182351 (-0.08%)
instructions in affected programs: 831151 -> 820607 (-1.27%)
helped: 5241
HURT: 116
total cycles in shared programs: 539249342 -> 539155930 (-0.02%)
cycles in affected programs: 21914368 -> 21820956 (-0.43%)
helped: 10718
HURT: 7182
LOST: 0
GAINED: 17
---
src/mesa/drivers/dri/i965/brw_link.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 217ecad8cdd..1b4184bb3fb 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -325,6 +325,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)
@@ -336,6 +337,19 @@ 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);
+
+ /* TODO: In future nir_compact_varyings() should update the varying
+ * input/output mask to reflect the packing it has just done. However
+ * until we have an array/matrix splitting pass we would just be
+ * duplicating the complex partial marking code in nir_gather_info().
+ */
+ brw_shader_gather_info(prog->nir, prog);
+ }
+ prev = stage;
+
infos[stage] = &prog->nir->info;
update_xfb_info(prog->sh.LinkedTransformFeedback, infos[stage]);
--
2.13.6
More information about the mesa-dev
mailing list