[Mesa-dev] [PATCH 63/65] i965: get scratch on cache restore

Timothy Arceri timothy.arceri at collabora.com
Fri Apr 29 13:34:02 UTC 2016


---
 src/mesa/drivers/dri/i965/brw_shader_cache.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/brw_shader_cache.c b/src/mesa/drivers/dri/i965/brw_shader_cache.c
index ac381d1..5d47122 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -239,6 +239,11 @@ upload_cached_program(struct brw_context *brw)
 
    vs_key.program_string_id = vp->id;
 
+   if (prog_data->total_scratch) {
+      brw_get_scratch_bo(brw, &brw->vs.base.scratch_bo,
+                         prog_data->total_scratch * brw->max_vs_threads);
+   }
+
    brw_upload_cache(&brw->cache, BRW_CACHE_VS_PROG,
                     &vs_key, sizeof(struct brw_vs_prog_key),
                     vs_program, vs_program_size,
@@ -343,6 +348,11 @@ upload_cached_program(struct brw_context *brw)
 
    wm_key.program_string_id = wp->id;
 
+   if (prog_data->total_scratch) {
+      brw_get_scratch_bo(brw, &brw->wm.base.scratch_bo,
+                         prog_data->total_scratch * brw->max_vs_threads);
+   }
+
    brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,
                     &wm_key, sizeof(struct brw_wm_prog_key),
                     wm_program, wm_program_size,
-- 
2.5.5



More information about the mesa-dev mailing list