[Mesa-dev] [PATCH 55/88] i965: get scratch on cache restore

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


---
 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 19b0c81..9d95ee9 100644
--- a/src/mesa/drivers/dri/i965/brw_shader_cache.c
+++ b/src/mesa/drivers/dri/i965/brw_shader_cache.c
@@ -241,6 +241,7 @@ upload_cached_vs(struct brw_context *brw, struct blob_reader *binary,
 {
    struct brw_vs_prog_data *vs_prog_data;
    struct brw_stage_prog_data *prog_data;
+   const struct gen_device_info *devinfo = &brw->screen->devinfo;
 
    /* Read VS program from blob. */
    size_t vs_program_size = blob_read_uint32(binary);
@@ -259,6 +260,9 @@ upload_cached_vs(struct brw_context *brw, struct blob_reader *binary,
       (struct brw_vertex_program *)brw->vertex_program;
    vs_key->program_string_id = vp->id;
 
+   brw_alloc_stage_scratch(brw, &brw->vs.base, prog_data->total_scratch,
+                           devinfo->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,
@@ -273,6 +277,7 @@ upload_cached_wm(struct brw_context *brw, struct blob_reader *binary,
 {
    struct brw_wm_prog_data *wm_prog_data;
    struct brw_stage_prog_data *prog_data;
+   const struct gen_device_info *devinfo = &brw->screen->devinfo;
 
    /* Read WM program from blob. */
    size_t wm_program_size = blob_read_uint32(binary);
@@ -292,6 +297,9 @@ upload_cached_wm(struct brw_context *brw, struct blob_reader *binary,
       (struct brw_fragment_program *)brw->fragment_program;
    wm_key->program_string_id = wp->id;
 
+   brw_alloc_stage_scratch(brw, &brw->wm.base, prog_data->total_scratch,
+                           devinfo->max_wm_threads);
+
    brw_upload_cache(&brw->cache, BRW_CACHE_FS_PROG,
                     wm_key, sizeof(struct brw_wm_prog_key),
                     wm_program, wm_program_size,
-- 
2.7.4



More information about the mesa-dev mailing list