diff options
author | Timothy Arceri <[email protected]> | 2018-02-16 11:41:17 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-02-20 13:15:02 +1100 |
commit | d88a2906f86843fa11d95f7ac2f39cd0b2713d72 (patch) | |
tree | adcc1a1b50ab226e2b3171646e44600452d372d2 /src/mesa | |
parent | 691c320de066ba71c61ad97a1a8b39687238d6ef (diff) |
st/shader_cache: copy nir pointer to gl_program after deserializing
This fixes a crash when running the arb_get_program_binary-api-errors
piglit test twice.
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index 6ff404220aa..3ca3fef1df2 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -215,6 +215,7 @@ st_deserialise_ir_program(struct gl_context *ctx, stvp->tgsi.type = PIPE_SHADER_IR_NIR; stvp->shader_program = shProg; stvp->tgsi.ir.nir = nir_deserialize(NULL, options, &blob_reader); + prog->nir = stvp->tgsi.ir.nir; } else { read_tgsi_from_cache(&blob_reader, &stvp->tgsi.tokens, &stvp->num_tgsi_tokens); @@ -237,6 +238,7 @@ st_deserialise_ir_program(struct gl_context *ctx, sttcp->tgsi.type = PIPE_SHADER_IR_NIR; sttcp->shader_program = shProg; sttcp->tgsi.ir.nir = nir_deserialize(NULL, options, &blob_reader); + prog->nir = sttcp->tgsi.ir.nir; } else { read_tgsi_from_cache(&blob_reader, &sttcp->tgsi.tokens, &sttcp->num_tgsi_tokens); @@ -259,6 +261,7 @@ st_deserialise_ir_program(struct gl_context *ctx, sttep->tgsi.type = PIPE_SHADER_IR_NIR; sttep->shader_program = shProg; sttep->tgsi.ir.nir = nir_deserialize(NULL, options, &blob_reader); + prog->nir = sttep->tgsi.ir.nir; } else { read_tgsi_from_cache(&blob_reader, &sttep->tgsi.tokens, &sttep->num_tgsi_tokens); @@ -281,6 +284,7 @@ st_deserialise_ir_program(struct gl_context *ctx, stgp->tgsi.type = PIPE_SHADER_IR_NIR; stgp->shader_program = shProg; stgp->tgsi.ir.nir = nir_deserialize(NULL, options, &blob_reader); + prog->nir = stgp->tgsi.ir.nir; } else { read_tgsi_from_cache(&blob_reader, &stgp->tgsi.tokens, &stgp->num_tgsi_tokens); @@ -300,6 +304,7 @@ st_deserialise_ir_program(struct gl_context *ctx, stfp->tgsi.type = PIPE_SHADER_IR_NIR; stfp->shader_program = shProg; stfp->tgsi.ir.nir = nir_deserialize(NULL, options, &blob_reader); + prog->nir = stfp->tgsi.ir.nir; } else { read_tgsi_from_cache(&blob_reader, &stfp->tgsi.tokens, &stfp->num_tgsi_tokens); @@ -319,6 +324,7 @@ st_deserialise_ir_program(struct gl_context *ctx, stcp->tgsi.ir_type = PIPE_SHADER_IR_NIR; stcp->shader_program = shProg; stcp->tgsi.prog = nir_deserialize(NULL, options, &blob_reader); + prog->nir = (nir_shader *) stcp->tgsi.prog; } else { read_tgsi_from_cache(&blob_reader, (const struct tgsi_token**) &stcp->tgsi.prog, |