stgp = st_geometry_program(st->ctx->GeometryProgram._Current);
assert(stgp->Base.Base.Target == GL_GEOMETRY_PROGRAM_NV);
- st->gp_variant = st_get_basic_variant(st, &stgp->tgsi, &stgp->variants);
+ st->gp_variant = st_get_basic_variant(st, PIPE_SHADER_GEOMETRY,
+ &stgp->tgsi, &stgp->variants);
st_reference_geomprog(st, &st->gp, stgp);
sttcp = st_tessctrl_program(st->ctx->TessCtrlProgram._Current);
assert(sttcp->Base.Base.Target == GL_TESS_CONTROL_PROGRAM_NV);
- st->tcp_variant = st_get_basic_variant(st, &sttcp->tgsi, &sttcp->variants);
+ st->tcp_variant = st_get_basic_variant(st, PIPE_SHADER_TESS_CTRL,
+ &sttcp->tgsi, &sttcp->variants);
st_reference_tesscprog(st, &st->tcp, sttcp);
sttep = st_tesseval_program(st->ctx->TessEvalProgram._Current);
assert(sttep->Base.Base.Target == GL_TESS_EVALUATION_PROGRAM_NV);
- st->tep_variant = st_get_basic_variant(st, &sttep->tgsi, &sttep->variants);
+ st->tep_variant = st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL,
+ &sttep->tgsi, &sttep->variants);
st_reference_tesseprog(st, &st->tep, sttep);
*/
struct st_basic_variant *
st_get_basic_variant(struct st_context *st,
+ unsigned pipe_shader,
struct pipe_shader_state *tgsi,
struct st_basic_variant **variants)
{
v = CALLOC_STRUCT(st_basic_variant);
if (v) {
/* fill in new variant */
- v->driver_shader = pipe->create_gs_state(pipe, tgsi);
+ switch (pipe_shader) {
+ case PIPE_SHADER_TESS_CTRL:
+ v->driver_shader = pipe->create_tcs_state(pipe, tgsi);
+ break;
+ case PIPE_SHADER_TESS_EVAL:
+ v->driver_shader = pipe->create_tes_state(pipe, tgsi);
+ break;
+ case PIPE_SHADER_GEOMETRY:
+ v->driver_shader = pipe->create_gs_state(pipe, tgsi);
+ break;
+ default:
+ assert(!"unhandled shader type");
+ free(v);
+ return NULL;
+ }
+
v->key = key;
/* insert into list */
case GL_TESS_CONTROL_PROGRAM_NV: {
struct st_tessctrl_program *p = (struct st_tessctrl_program *)prog;
- st_get_basic_variant(st, &p->tgsi, &p->variants);
+ st_get_basic_variant(st, PIPE_SHADER_TESS_CTRL, &p->tgsi, &p->variants);
break;
}
case GL_TESS_EVALUATION_PROGRAM_NV: {
struct st_tesseval_program *p = (struct st_tesseval_program *)prog;
- st_get_basic_variant(st, &p->tgsi, &p->variants);
+ st_get_basic_variant(st, PIPE_SHADER_TESS_EVAL, &p->tgsi, &p->variants);
break;
}
case GL_GEOMETRY_PROGRAM_NV: {
struct st_geometry_program *p = (struct st_geometry_program *)prog;
- st_get_basic_variant(st, &p->tgsi, &p->variants);
+ st_get_basic_variant(st, PIPE_SHADER_GEOMETRY, &p->tgsi, &p->variants);
break;
}