summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_wm.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-01-24 08:41:36 +1100
committerJordan Justen <[email protected]>2017-10-31 23:36:54 -0700
commit2589e7ddafb63583498f5f7138914d2a2e634960 (patch)
tree86876affe556456b499d78a3189bc2f3e637c08f /src/mesa/drivers/dri/i965/brw_wm.c
parent516d50db319396c23fd599012aec8b3fbc0ee5a6 (diff)
i965: Add shader cache support for vertex and fragment stages
This enables the cache on vertex and fragment shaders only. v2: * Use MAYBE_UNUSED. (Matt) [[email protected]: reword subject] [[email protected]: *_cached_program => brw_disk_cache_*_program] Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_wm.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c
index 34a3a1e5c16..08bacebd571 100644
--- a/src/mesa/drivers/dri/i965/brw_wm.c
+++ b/src/mesa/drivers/dri/i965/brw_wm.c
@@ -595,15 +595,21 @@ brw_upload_wm_prog(struct brw_context *brw)
brw_wm_populate_key(brw, &key);
- if (!brw_search_cache(&brw->cache, BRW_CACHE_FS_PROG,
- &key, sizeof(key),
- &brw->wm.base.prog_offset,
- &brw->wm.base.prog_data)) {
- bool success = brw_codegen_wm_prog(brw, fp, &key,
- &brw->vue_map_geom_out);
- (void) success;
- assert(success);
- }
+ if (brw_search_cache(&brw->cache, BRW_CACHE_FS_PROG,
+ &key, sizeof(key),
+ &brw->wm.base.prog_offset,
+ &brw->wm.base.prog_data))
+ return;
+
+ if (brw_disk_cache_upload_program(brw, MESA_SHADER_FRAGMENT))
+ return;
+
+ fp = (struct brw_program *) brw->programs[MESA_SHADER_FRAGMENT];
+ fp->id = key.program_string_id;
+
+ MAYBE_UNUSED bool success = brw_codegen_wm_prog(brw, fp, &key,
+ &brw->vue_map_geom_out);
+ assert(success);
}
bool