- 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");
- _mesa_sha1_compute(buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_TESS_CTRL: {
- struct st_tessctrl_program *stcp =
- (struct st_tessctrl_program *) glprog;
- stage_sha1[i] = stcp->sha1;
- ralloc_strcat(&buf, " tcs");
- _mesa_sha1_compute(buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_TESS_EVAL: {
- struct st_tesseval_program *step =
- (struct st_tesseval_program *) glprog;
- stage_sha1[i] = step->sha1;
- ralloc_strcat(&buf, " tes");
- _mesa_sha1_compute(buf, strlen(buf), stage_sha1[i]);
- break;
- }
- case MESA_SHADER_GEOMETRY: {
- struct st_geometry_program *stgp =
- (struct st_geometry_program *) glprog;
- stage_sha1[i] = stgp->sha1;
- ralloc_strcat(&buf, " gs");
- _mesa_sha1_compute(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");
- _mesa_sha1_compute(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");
- _mesa_sha1_compute(buf, strlen(buf), stage_sha1[i]);
- break;
- }
- default:
- unreachable("Unsupported stage");
- }