diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_link.cpp | 7 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.c | 11 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_program.h | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp index 6177c8f5ebd..64267671c05 100644 --- a/src/mesa/drivers/dri/i965/brw_link.cpp +++ b/src/mesa/drivers/dri/i965/brw_link.cpp @@ -355,12 +355,7 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg) continue; struct gl_program *prog = shader->Program; - struct blob writer; - blob_init(&writer); - nir_serialize(&writer, prog->nir); - prog->driver_cache_blob = ralloc_size(NULL, writer.size); - memcpy(prog->driver_cache_blob, writer.data, writer.size); - prog->driver_cache_blob_size = writer.size; + brw_program_serialize_nir(ctx, prog); } } diff --git a/src/mesa/drivers/dri/i965/brw_program.c b/src/mesa/drivers/dri/i965/brw_program.c index 30cc14e88a2..be839ab38a2 100644 --- a/src/mesa/drivers/dri/i965/brw_program.c +++ b/src/mesa/drivers/dri/i965/brw_program.c @@ -788,6 +788,17 @@ brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo, } void +brw_program_serialize_nir(struct gl_context *ctx, struct gl_program *prog) +{ + struct blob writer; + blob_init(&writer); + nir_serialize(&writer, prog->nir); + prog->driver_cache_blob = ralloc_size(NULL, writer.size); + memcpy(prog->driver_cache_blob, writer.data, writer.size); + prog->driver_cache_blob_size = writer.size; +} + +void brw_program_deserialize_nir(struct gl_context *ctx, struct gl_program *prog, gl_shader_stage stage) { diff --git a/src/mesa/drivers/dri/i965/brw_program.h b/src/mesa/drivers/dri/i965/brw_program.h index bd9b4ad168a..c89614d5c90 100644 --- a/src/mesa/drivers/dri/i965/brw_program.h +++ b/src/mesa/drivers/dri/i965/brw_program.h @@ -82,6 +82,8 @@ brw_assign_common_binding_table_offsets(const struct gen_device_info *devinfo, uint32_t next_binding_table_offset); void +brw_program_serialize_nir(struct gl_context *ctx, struct gl_program *prog); +void brw_program_deserialize_nir(struct gl_context *ctx, struct gl_program *prog, gl_shader_stage stage); |