+ struct st_program *old_vp = st->vp;
+ struct st_program *old_tcp = st->tcp;
+ struct st_program *old_tep = st->tep;
+ struct st_program *old_gp = st->gp;
+ struct st_program *old_fp = st->fp;
+
+ struct gl_program *new_vp = ctx->VertexProgram._Current;
+ struct gl_program *new_tcp = ctx->TessCtrlProgram._Current;
+ struct gl_program *new_tep = ctx->TessEvalProgram._Current;
+ struct gl_program *new_gp = ctx->GeometryProgram._Current;
+ struct gl_program *new_fp = ctx->FragmentProgram._Current;
+ uint64_t dirty = 0;
+ unsigned num_viewports = 1;
+
+ /* Flag states used by both new and old shaders to unbind shader resources
+ * properly when transitioning to shaders that don't use them.
+ */
+ if (unlikely(new_vp != (old_vp ? &old_vp->Base : NULL))) {
+ if (old_vp)
+ dirty |= old_vp->affected_states;
+ if (new_vp)
+ dirty |= ST_NEW_VERTEX_PROGRAM(st, st_program(new_vp));
+ }