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

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 29 13:34:01 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 | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index 5de261c..ac381d1 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -47,6 +47,7 @@ gen_binary_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 + offset, sizeof(manifest) - offset,
                       "program: %s\n", _mesa_sha1_format(sha1_buf, prog->sha1));
@@ -57,12 +58,19 @@ gen_binary_sha1(struct brw_context *brw, struct gl_shader_program *prog,
    offset += snprintf(manifest + offset, sizeof(manifest) - offset,
                       "vs_key: %s\n", _mesa_sha1_format(sha1_buf, 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));
 
+   brw->vue_map_geom_out.slots_valid = current_valid;
+
    _mesa_sha1_compute(manifest, strlen(manifest), brw->binary_sha1);
 
 }
-- 
2.5.5



More information about the mesa-dev mailing list