[Mesa-dev] [PATCH 54/88] i965: generate outputs written for use in fs key

Timothy Arceri timothy.arceri at collabora.com
Sat Sep 24 05:25:35 UTC 2016


This is normally generated at link time so we need to do it ourselves
for use with the shader cache.
---
 src/mesa/drivers/dri/i965/brw_shader_cache.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index aaeb6ba..19b0c81 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -67,18 +67,25 @@ gen_wm_sha1(struct brw_context *brw, struct gl_shader_program *prog,
    unsigned char sha1[20];
    char manifest[256];
    int offset = 0;
+   struct gl_program *vs = (struct gl_program *) brw->vertex_program;
 
    offset += snprintf(manifest, sizeof(manifest), "program: %s\n",
                       _mesa_sha1_format(sha1_buf, prog->sha1));
 
+   GLbitfield64 current_valid = brw->vue_map_geom_out.slots_valid;
+   GLbitfield64 outputs_written =
+      brw_vs_outputs_written(brw, vs_key, vs->OutputsWritten);
+   brw->vue_map_geom_out.slots_valid = outputs_written;
+
    brw_wm_populate_key(brw, wm_key);
    wm_key->program_string_id = 0;
    _mesa_sha1_compute(wm_key, sizeof *wm_key, sha1);
    offset += snprintf(manifest + offset, sizeof(manifest) - offset,
                       "wm_key: %s\n", _mesa_sha1_format(sha1_buf, sha1));
 
-   _mesa_sha1_compute(manifest, strlen(manifest), wm_sha1);
+   brw->vue_map_geom_out.slots_valid = current_valid;
 
+   _mesa_sha1_compute(manifest, strlen(manifest), wm_sha1);
 }
 
 static void
-- 
2.7.4



More information about the mesa-dev mailing list