- struct gl_program *glprog = prog->_LinkedShaders[i]->Program;
- switch (glprog->info.stage) {
- case MESA_SHADER_VERTEX: {
- struct st_vertex_program *stvp = (struct st_vertex_program *) glprog;
- stage_sha1[i] = stvp->sha1;
- ralloc_strcat(&buf, " vs");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_TESS_CTRL: {
- struct st_common_program *stcp =
- (struct st_common_program *) glprog;
- stage_sha1[i] = stcp->sha1;
- ralloc_strcat(&buf, " tcs");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_TESS_EVAL: {
- struct st_common_program *step =
- (struct st_common_program *) glprog;
- stage_sha1[i] = step->sha1;
- ralloc_strcat(&buf, " tes");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_GEOMETRY: {
- struct st_common_program *stgp =
- (struct st_common_program *) glprog;
- stage_sha1[i] = stgp->sha1;
- ralloc_strcat(&buf, " gs");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_FRAGMENT: {
- struct st_fragment_program *stfp =
- (struct st_fragment_program *) glprog;
- stage_sha1[i] = stfp->sha1;
- ralloc_strcat(&buf, " fs");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_COMPUTE: {
- struct st_compute_program *stcp =
- (struct st_compute_program *) glprog;
- stage_sha1[i] = stcp->sha1;
- ralloc_strcat(&buf, " cs");
- disk_cache_compute_key(ctx->Cache, buf, strlen(buf), stage_sha1[i]);
- break;
- }
- default:
- unreachable("Unsupported stage");
- }
-
- ralloc_free(buf);
- }