diff options
author | Timothy Arceri <[email protected]> | 2017-11-28 21:43:12 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2018-01-17 23:43:28 +1100 |
commit | c69b0dd6817b3321d0d9ccfd1c3d44b44277c736 (patch) | |
tree | e2f2f4c19792821336ada3b550fea3709bb5914a /src/mesa/state_tracker/st_shader_cache.c | |
parent | 7b0e8264dd21ae05521d08d41fecd84139401fef (diff) |
st/glsl_to_tgsi: store num_tgsi_tokens in st_*_program
We will need this for ARB_get_program_binary binary support.
Tested-by: Dieter Nützel <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_shader_cache.c')
-rw-r--r-- | src/mesa/state_tracker/st_shader_cache.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c index a5e33133b3c..a9413fb0534 100644 --- a/src/mesa/state_tracker/st_shader_cache.c +++ b/src/mesa/state_tracker/st_shader_cache.c @@ -56,8 +56,7 @@ write_tgsi_to_cache(struct blob *blob, struct pipe_shader_state *tgsi, */ void st_store_tgsi_in_disk_cache(struct st_context *st, struct gl_program *prog, - struct pipe_shader_state *out_state, - unsigned num_tokens) + struct pipe_shader_state *out_state) { if (!st->ctx->Cache) return; @@ -83,24 +82,28 @@ st_store_tgsi_in_disk_cache(struct st_context *st, struct gl_program *prog, sizeof(stvp->result_to_output)); write_stream_out_to_cache(&blob, &stvp->tgsi); - write_tgsi_to_cache(&blob, &stvp->tgsi, prog, num_tokens); + write_tgsi_to_cache(&blob, &stvp->tgsi, prog, stvp->num_tgsi_tokens); break; } case MESA_SHADER_TESS_CTRL: case MESA_SHADER_TESS_EVAL: case MESA_SHADER_GEOMETRY: { + struct st_common_program *stcp = (struct st_common_program *) prog; + write_stream_out_to_cache(&blob, out_state); - write_tgsi_to_cache(&blob, out_state, prog, num_tokens); + write_tgsi_to_cache(&blob, out_state, prog, stcp->num_tgsi_tokens); break; } case MESA_SHADER_FRAGMENT: { struct st_fragment_program *stfp = (struct st_fragment_program *) prog; - write_tgsi_to_cache(&blob, &stfp->tgsi, prog, num_tokens); + write_tgsi_to_cache(&blob, &stfp->tgsi, prog, stfp->num_tgsi_tokens); break; } case MESA_SHADER_COMPUTE: { - write_tgsi_to_cache(&blob, out_state, prog, num_tokens); + struct st_compute_program *stcp = (struct st_compute_program *) prog; + + write_tgsi_to_cache(&blob, out_state, prog, stcp->num_tgsi_tokens); break; } default: |